Project

General

Profile

Actions

Bug #25640

closed

Adding a task provided by an extension fails

Added by Administrator Admin almost 15 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2009-12-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I set up a task in an extension as described in the documentation (of the scheduler) and according to the examples of the class.tx_scheduler.

But if I add the task in the scheduler, all goes fine until I press the "save" button - this provokes the following error message:
Fatal error: Class 'user_myextension_myclass' not found in /html/typo3/typo3_src-4.3.0/t3lib/class.t3lib_div.php on line 4942

Could this be a bug of the scheduler, or maybe of the autoloader?

Typo3 4.3.0
PHP 5.2.11
(issue imported from #M13072)

Actions #1

Updated by Chris topher almost 15 years ago

I also tryed adding a task and it works for me.
Does the extension correctly list its classes in ext_autoload.php?

There is a good article on how all this should look like here:
http://typo3blogger.de/vom-standalone-cli-zum-scheduler/

Actions #2

Updated by Francois Suter almost 15 years ago

I would also bet on an autoloader error, since I have successfully created tasks for the scheduler myself. Mind that the autoloader is case-sensitive, so you should write your class' name all lowercase.

Actions #3

Updated by Administrator Admin almost 15 years ago

Thanks for replies,
- @Christopher: my class is listed in my ext_autoload.php as described in your script
- @Francois Suter Suter: my class is lowercase and all names are given accordingly to the Typo3 Coding Guidelines (I also noticed your discussion about case-sensitivity and the autoloader at 0012519: autoloader doesn't support ext_autoload from extensions having underscore in extkey )

Could it be possibly related to this issue: http://forge.typo3.org/issues/show/5186

Actions #4

Updated by Administrator Admin almost 15 years ago

I can happily tell you that I found a (temporary) workaround: I just pasted the code from my ext_autoload.php to typo3/sysext/scheduler/ext_autoload.php - and everything works fine!

So the bug seems to be caused by the autoloader not reading my typo3conf/ext/myext/ext_autoload.php as it is supposed to do!

Actions #5

Updated by Administrator Admin almost 15 years ago

Solved:

Since my extension was for a company-specific purpose, I prefixed it with "user_", for I understood this to be what the Typo3 Coding Guidelines demand - maybe a misunderstanding from my side.

But the autoloader interpreted this being part of the extension key, generating the known problem with extension keys having an underscore in their name.

I changed the prefix of the extension from "user_" to "tx_" (which was quite awful), and now everything works fine.

I think it would be a good idea if somebody could tell the autoloader that "user_" is a prefix and not part of the extension key!

Actions #6

Updated by Francois Suter almost 15 years ago

I see the problem indeed. However I'm not sure it's a good idea for the autoloader to support the "user_" prefix. Having an autoloader is also about having strict naming conventions and all classes inside an extension are expected to be prefixed with "tx_" and not with "user_".

If you want to push for an autoloader change, can you please open a separate bug report, as it is not related to the scheduler anyway.

I will close this report.

Actions #7

Updated by Francois Suter almost 15 years ago

As discussed, not a scheduler issue.

Actions #8

Updated by Michael Stucki almost 11 years ago

  • Category set to scheduler
Actions #9

Updated by Michael Stucki almost 11 years ago

  • Project changed from 739 to TYPO3 Core
  • Category changed from scheduler to scheduler
  • Target version deleted (0)
Actions

Also available in: Atom PDF