?
avatar mahagr
mahagr
16 Jun 2017

Steps to reproduce the issue

Install latest Gantry 5 package from https://github.com/gantry/gantry5/releases/download/5.4.13/joomla-pkg_gantry5_v5.4.13.zip and then install it again.

Expected result

Installation should succeed without warnings and if you go to Extensions > Manage > Manage and filter by Gantry 5, you should see Gantry 5 Framework library entry only a single time.

Actual result

During second installation you will see a warning:

Warning
The Gantry 5 Framework extension is part of a package which does not allow individual extensions to be uninstalled.

When you visit Extensions > Manage > Manage, you will see the library installed 2 times. Every new install after this will add a new extension entry.

System information (as much as possible)

Tested with Joomla 3.7.2

Additional comments

This bug was introduced in pull #13154 by @mbabker. It looks like that preventing uninstallation for child extensions will break library installation, which works by uninstalling library before installing the new version.

avatar mahagr mahagr - open - 16 Jun 2017
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jun 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Jun 2017
avatar mahagr mahagr - change - 16 Jun 2017
The description was changed
avatar mahagr mahagr - edited - 16 Jun 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Jun 2017
Category com_installer
avatar mahagr
mahagr - comment - 16 Jun 2017

Hmm.. Looks like there's no easy workaround for the issue.

Also: should the installation of the package fail if library cannot be uninstalled?

avatar mbabker
mbabker - comment - 16 Jun 2017

This honestly looks to be a very edge case scenario with your stuff if you're trying to fully uninstall something in the middle of an install/upgrade routine.

Since you're triggering an uninstall in the middle of an install/update routine, I assume you are also doing this within a custom script because core is definitely not doing this. Call JInstaller::setPackageUninstall(true) and you can bypass that warning.

avatar mahagr
mahagr - comment - 16 Jun 2017

@mbabker I'm not doing anything. It's all Joomla. Just create a package with a library in it and use your feature. :)

Here is the code that fails:

https://github.com/mbabker/joomla-cms/blob/9ac535494ee8cffa96341d39b15890121a7707c2/libraries/cms/installer/adapter/library.php#L337

Unfortunately calling the JInstaller::setPackageUninstall(true) didn't help (tried it before writing this report) as installer creates a new instance of the installer just before removing the package. I wasn't sure if it is the right method, but yeah, I think we can fix the library installer by doing just that.

avatar mahagr
mahagr - comment - 16 Jun 2017

Yeah, I noticed it when we were rewriting the installer first time (some of the work went later to the current version). I was going to look into it, but we took too large a bite back then and the work was dropped for a long time. There's also issue in template uninstaller not calling the install script, btw..

avatar mahagr
mahagr - comment - 16 Jun 2017

Anyway, do I write a quick patch to fix this one or are you going to look into it? Unfortunately, my work situation doesn't allow me to look deeper into this. :(

avatar mbabker
mbabker - comment - 16 Jun 2017

That one's an easy patch if you've got the time. As for anything bigger, it's all going into 4.0 at this point because I am making B/C breaks along the way (namely abstract base functions).

avatar mahagr
mahagr - comment - 16 Jun 2017

Yea, I can add the call. As for J4.0, the installer is much better thanks to the work you've put into it, but there are still parts that are the broken old code. A few installers still have issues, so it would be nice to finish the work.

Anyway, I really appreciate all the work you're still putting into Joomla and I can only wonder how you are finding all the time for it. Two years back I was almost sure that by now you'd given up your position. :)

avatar mahagr
mahagr - comment - 16 Jun 2017

@mbabker The fix works. Is staging still 3.7.x? Or which branch should I use as the base?

avatar Bakual
Bakual - comment - 16 Jun 2017

staging is 3.7.3

avatar mahagr
mahagr - comment - 16 Jun 2017

Alright, the fix is up there ^

avatar joomla-cms-bot joomla-cms-bot - change - 16 Jun 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-06-16 19:06:28
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 16 Jun 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Jun 2017
Closed_By joomla-cms-bot franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Jun 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jun 2017

closed as having PR #16729


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

avatar mahagr
mahagr - comment - 16 Jun 2017

FYI @mbabker I looked into other installers and the library one is the only one which uses uninstall.

avatar mbabker
mbabker - comment - 16 Jun 2017

Well in good news that means there's only one adapter to remove the FUBAR flag from in 4.0 ;-)

Add a Comment

Login with GitHub to post a comment