?
avatar zero-24
zero-24
22 Feb 2017

Steps to reproduce the issue

Install 3.7.0b3 -> hit the reinstall button.

Expected result

Just reinstall

Actual result

image

image

avatar zero-24 zero-24 - open - 22 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 Feb 2017
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Feb 2017
avatar zero-24 zero-24 - edited - 22 Feb 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Feb 2017

can confirm issue.

avatar infograf768
infograf768 - comment - 23 Feb 2017

This happens because this menu is added as postflight in script.php.
@rdeutz Any way to check in the code if the menu item already exists or not?

avatar rdeutz
rdeutz - comment - 23 Feb 2017

as far as I remember than this should only run when you come from a version less than 3.7.0, not sure what is different with reinstall, will have a look

avatar infograf768
infograf768 - comment - 23 Feb 2017

Maybe because of the beta# added?

avatar mbabker
mbabker - comment - 23 Feb 2017

The preflight hook in the core script.php file runs after the package has been extracted by restore.php. So at that point it is already going to have the new version number, so $this->fromVersion is unreliable (it will always be the version you've upgraded to at least with the "normal" path and I sure hope the manual upload steps do things in the same order).

The core update system doesn't follow the same order of operations as an extension update, basically everything in script.php is a post filesystem update operation instead of having hook points before the filesystem updates are performed. You would have to add hooks into other parts of com_joomlaupdate if you really wanted to have a pre-filesystem operation.

Your postflight check will need to be a query to determine if the item exists first then create one if one isn't found.

avatar rdeutz
rdeutz - comment - 23 Feb 2017

Last time as I checked it, the formVersion was the old version because it comes from the manifest cache and the preflight runs before the manifest cache gets updated. Only looking if the item exists doesn't work because someone could delete the extension (direct road to hell), but that's the reason I did it this way. I'll add the check if the menu item exists. Than we are save

avatar mbabker
mbabker - comment - 23 Feb 2017

Oh, I missed the manifest cache part. In that case you should be fine.

avatar rdeutz
rdeutz - comment - 24 Feb 2017

fixed with 19e415d

avatar rdeutz rdeutz - change - 24 Feb 2017
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-02-24 20:43:42
Closed_By rdeutz
avatar rdeutz rdeutz - close - 24 Feb 2017
avatar rdeutz rdeutz - change - 24 Feb 2017
Labels Removed: ?
avatar rdeutz rdeutz - unlabeled - 24 Feb 2017

Add a Comment

Login with GitHub to post a comment