An archival instance of Joomla 2 broke on PHP 7.
The user facing bits would work, but the control panel won't. The administrator login would accept a correct username and password, display no error messages, then redirect to /administrator/index.php and display the login form again, and so ad infinitum.Just this this will help anyone struggling with the same: internally, a user record upon logon would not get saved in the PHP session, which internally had to do with event misdelivery. To fix, open the file libraries/joomla/event/dispatch.php. Find line 226 (in my version). It goes:
$this->_observers[] = $observer;
After this line, add the following:
end($this->_observers);
In the other branch of the initial if(), the logic moves the current position of the observers array to the end after inserting an observer into it. Later, the key() function is used to retrieve the index of the freshly added observer. Without the end() call, the current position won't be at the end.
Not sure what was it exactly that broke this flow in PHP7, but there you go.
You might want to add the patch statement on the same line so that line numbering the file doesn't shift.
No comments:
Post a Comment