? Pending
Pull Request for # 9014

User tests: Successful: Unsuccessful:

avatar Harmageddon
Harmageddon
27 Feb 2016

Pull Request for Issue #9014 .

Credits for this PR to @zero-24 who investigated this issue and proposed this fix!

Summary of Changes

  • Change 1: Restart the session only, if we have no active session.
  • Change 2: Inside the "truncateTable" function, the table name is quoted already, so we don't need to quote the argument, which would lead to a double quoted table name and thus to a MySQL error.

Testing Instructions

An update package including this change (modified version of the beta 2 package) can be found here. Please note that the only change included in this package is the one from this PR. So you might encounter other issues which were already fixed since the release of beta2.

Please test this update package (or an own one including these changes) for the following cases:

  1. Update from 3.4.5 or older versions.
    • Expected behavior: You should be logged out, because the session in the old format from 3.4.5 or older has to be deleted and a new session in the new, safer format has to be started.
  2. Update from 3.4.8
    • Expected behavior: You should not be logged out, because you already have a session in the new format.
  3. Update from beta2
    • Expected behavior: Same as for 3.4.8.

@nikosdion As the first change of this PR will mostly affect updates via Akeeba CLI, could you please check if this introduces any issues?

avatar Harmageddon Harmageddon - open - 27 Feb 2016
avatar Harmageddon Harmageddon - change - 27 Feb 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2016
Labels Added: ?
avatar Harmageddon Harmageddon - change - 27 Feb 2016
Category Authentication Updating
avatar Harmageddon Harmageddon - change - 27 Feb 2016
Rel_Number 0 9014
Relation Type Pull Request for
avatar zero-24 zero-24 - test_item - 27 Feb 2016 - Tested successfully
avatar zero-24
zero-24 - comment - 27 Feb 2016

I have tested this item :white_check_mark: successfully on d83e73f

Works good here. I have tested all three steps with success. #jcamp2016

@wilsonge @roland-d please have a look here too as it is a show stopper for 3.5

Thanks @Harmageddon for helping testing and fixing :+1:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9230.

avatar nikosdion
nikosdion - comment - 27 Feb 2016

Session restart under CLI has no effect except, at worst, a warning message. It's fine by me :)

avatar wilsonge wilsonge - change - 27 Feb 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-02-27 14:40:47
Closed_By wilsonge
avatar wilsonge wilsonge - close - 27 Feb 2016
avatar wilsonge wilsonge - reference | dc30e1d - 27 Feb 16
avatar wilsonge wilsonge - merge - 27 Feb 2016
avatar wilsonge wilsonge - close - 27 Feb 2016
avatar wilsonge wilsonge - change - 27 Feb 2016
Milestone Added:
avatar wilsonge
wilsonge - comment - 27 Feb 2016

Merged - thanks guys for delving into this one!

avatar zero-24
zero-24 - comment - 27 Feb 2016

Thanks @wilsonge for merging :+1:

avatar wilsonge
wilsonge - comment - 28 Feb 2016

OK I have bad news for both of you. This breaks updates from 2.5.28 to 3.4. It fatals with

Fatal error: Call to undefined method JSession::isActive() in /path/to/joomla/tmp/install_56d23f3a6c21b/administrator/components/com_admin/script.php on line 1618

Unless you guys can find a solution I'll need to revert this PR :(

avatar zero-24
zero-24 - comment - 28 Feb 2016

@wilsonge i guess you mean 2.5.28 to 3.5?

Therfor we Can try to check with The method: getstate() !== 'active'

Please not revert here an let me check if I'm back to my Computer from Essen.

The Problem as always in that updater Script we have only that methods that are availibary in the former release. So getActive was released in the 3.x. But please let me check this withe the other method.

avatar zero-24
zero-24 - comment - 28 Feb 2016

@wilsonge see: #9240 i got a fix that works for me also for 2.5 to 3.5beta2 Updates. Please check. There is also a fixed update package.

avatar nikosdion
nikosdion - comment - 28 Feb 2016

@zero-24 Or, you could do it backwards- and forwards-compatible:

$activeSession = method_exists($session, 'isActive') ? $session->isActive() : $session->getState() !== 'active';
if (!$activeSession)
{
    $session->restart();
}

This will allow your code to work also when getState() is removed: IIRC this is what Framework 2.0 has done and that change will get into the Joomla! CMS at some point.

And I still maintain that the source of many upgrade problems is allowing script.php to run inside the context of the old Joomla! version's code base. But I digress. The fix above should work with all versions of Joomla! 2.5 and 3.x.

avatar Harmageddon
Harmageddon - comment - 28 Feb 2016

@nikosdion

This will allow your code to work also when getState() is removed: IIRC this is what Framework 2.0 has done and that change will get into the Joomla! CMS at some point.

I just looked into the framework repo (not sure though if I found the right one) and getState is still there and not marked as deprecated: https://github.com/joomla-framework/session/blob/master/Session.php#L202

Add a Comment

Login with GitHub to post a comment