Fatal Error: Cannot redeclare "make_selector"
using the forge version of your extension I get the following error message after clearing the cache:
Fatal error: Cannot redeclare make_selector() (previously declared in [...]/typo3conf/temp_CACHED_FE_psf429_ext_tables.php:xxxx) in [...]/typo3conf/temp_CACHED_FE_psf429_ext_tables.php on line yyyy
Solution is to move both functions "make_selector" and "apply_strftime" out of ext_tables.php into an own file and add it via require_once().
I will add a patch in a couple of minutes.
#2 Updated by Andreas Kiefer almost 8 years ago
- Status changed from New to Needs Feedback
- Assignee set to Andreas Kiefer
thank you for the patch.
I tried to reproduce the described error but failed. Could you please give me some information about your T3 and PHP version?
Thanks in advance for your reply,
#3 Updated by Jonas Götze over 7 years ago
I just had the same issue twice with newest TER Version. But it only occured if I went to registration form, filled out the fields (username and password) and submitted the form. For some weird reason form submit won't work for me since I updated to new TER version (will be a separate issue if I figured out the problem) and I am getting back to the form again without any messages. My Data is still entered in the form. If I clear the cache now and try to submit once again I am getting the error described by Marcus.
It also occurs if I leave the password empty and come back to the form with the corresponding error message. After clearing cache and submit again - voîlà.
Hope this helps.
TYPO3 4.7.1 and PHPv5.3.10-1
EDIT: Submitting the form works now - configuration issue. Errors seems to occur after every form submit if cache was cleared before.
#4 Updated by Andreas Kiefer over 7 years ago
Thank you. I still don't get this error message, but I noticed that there is an error in ext_tables.php. The field definitions for the birthday selects were included twice, this should be the reason. I fixed this in current SVN trunk. Please check if the error is fixed with these changes.
#5 Updated by Marcus Schwemer over 7 years ago
After a long time, I logged into the InstallTool. My patches lead to a fatal error there. So they are not usable ...
My current idea is that the ext_tables.php is included twice in our installation. I'll investigate further and will give feedback.
#6 Updated by Marcus Schwemer over 7 years ago
I can now reproduce this behaviour. How?
- Install ke_userregister
- add static templates
- add the pi1 to a page (probably works with pi2 and pi3 also)
- install extbase
- install an extbase FE extension (for example: yag)
In the customer project we have own, not yet released to TER; in my test environment I used yag. Another example might be "news" from Georg Ringer.
- add static templates
- add plugin to the page where ke_userregister resides
- clear the caches (exp. temp_CACHED*)
- reload the page and ...
- voila ... the error occurs
Can you confirm this?
TYPO3 Version: 4.5.x
PHP Version: 5.3.x
2 thoughts come to my mind:
- Blame extbase
Extbase seem to start the init / caching process a 2nd time and this leads to the situation that ext_tables.php is cached twice and thus leads to the duplication of function definitions in temp_CACHED_*
This is no problem as ext_tables.php contains only calls to existing functions and overwrites the TCA array: Always the latter will win.
- ext_tables.php is not meant to contain extension specific functions
- One cannot be sure that another extension uses the same function name
The error would IMO also occur if another ext uses make_selector in ext_tables.php (without extbase)
Howto proceed then?
Yeah, would be cool if it is solved at this level ... but I doubt 1) whether it will happen and 2) when it will happen.
Modify my patch to distinguish between backend and frontend context regarding the paths in the require_once line. I'll try that and update the ticket.