Bug #16136
closedCrash when changing BE user password
0%
Description
1. Log in as a BE user with administrator rights.
2. User > Preferences
3. Enter a new password twice.
4. Click somewhere on the page so that both password fields are filled with asterisks.
5. Click on the "save" button.
Expected results:
a message: "data has been saved"
Actual results:
A crash in the right frame:
Fatal error: Cannot redeclare class template in /Applications/MAMP/htdocs/typo3_src-4.1.2/typo3/template.php on line 169
This happens only when changing the password, not when just saving the user preferences.
(issue imported from #M6056)
Files
Updated by Oliver Klee over 17 years ago
This also happens when changing the user's real name, but not when changing the BE language. Probably this is related to text input fields.
Updated by Oliver Hader over 17 years ago
I could reproduce this behavious with static_info_tables:
Fatal error: Cannot re-assign $this in [PATH]typo3conf/ext/static_info_tables/class.tx_staticinfotables_syslanguage.php on line 43
And on line 43 of the mentioned file we have a:
function processDatamap_postProcessFieldArray($status, $table, $id, $fieldArray, <b>$this</b>) {
So, the "$this" variable breaks the whole thing. It's not a bug of the core but of an extension in my case.
I bet that you have a similar extension on your system. Just grep for "$this" in function declaration in your typo3conf/ext directory. Or maybe you've got an XCLASS for template? Or there is a require('template.php') instead of a required_once('template.php').
Updated by Oliver Hader over 17 years ago
I've added a patch that changes all require() to require_once() in the core. Maybe in your case template.php was loaded by a hook/module or whatever before and then again by a "require('template.php');".
I'm not sure if this helps in your specific situation but it's a begining to change this for 4.1 and Trunk. The attached patch "0006056_41.patch" was created against the 4.1 branch.
Updated by Oliver Klee over 17 years ago
I've tried the patch. It doesn't help in my particular situation, but it doesn't make things worse either. :-) So I think the patch is the right way to go anyway.
So I tested whether uninstalling the installed extensions helped. It turned out that my extension "seminars" was the culprit (or at least the trigger) - even after changing the remaining include to include_once.
Yet, I don't quite get it why the error occurs. If I add the following code to the top of template.php...:
if (defined('TEMPLATE_INCLUDED')) {
print_debug_backtrace();
} else {
define('TEMPLATE_INCLUDED', 1);
echo 'Not included yet!';
}
... I get the following output when trying to change the BE user's real name:
Not included yet!
Fatal error: Cannot redeclare class template in /Applications/MAMP/htdocs/typo3_src-4.1.2/typo3/template.php on line 173
I'm at a loss here. Do you have any idea why this is happening?
Updated by Oliver Hader over 17 years ago
On line 525 in typo3/sysext/setup/mod/index.php I found another require('template.php') I missed because of a additional whitespace. If I change this to require_once(), the "cannot redeclare" messages disappear but the $LANG object is empty/null...
I changed $LANG at the end of typo3/template.php to $GLOBALS['LANG'] and everything was fine again. But I don't understand, where this $LANG object gets lost or set to NULL?! Very strange...
Updated by Chris topher over 14 years ago
Resolved, unable to reproduce with current versions.