Bug #25640
closed
Adding a task provided by an extension fails
Added by Administrator Admin almost 15 years ago.
Updated almost 11 years ago.
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)
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.
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
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!
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!
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.
As discussed, not a scheduler issue.
- Category set to scheduler
- Project changed from 739 to TYPO3 Core
- Category changed from scheduler to scheduler
- Target version deleted (
0)
Also available in: Atom
PDF