New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow folders in packages to be uninstalled like zips #8089
Conversation
foreach ($xml->files->folder as $folder) | ||
{ | ||
// NOTE: JInstallerExtension doesn't expect a string. | ||
// DO NOT CAST $file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you what to write DO NOT CAST $folder
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't write that, I just copy-pasted :)
Good catch, I will adjust that ;-)
Some comments (unrelated to the possibility or not to include folders instead of .zip for admin and site): The names of the .zips proposed above (id.zip, bg.zip) do not follow the format used to pick them in the http://update.joomla.org/language/translationlist_3.xml for Extensions=>Updates proposed as well as install from Extensions=>Manage=>Install Languages. The package name should be of the type: Concerning:
The manifest is a package and as such, has to be uninstalled as a package. If a part of the package (site or admin) is uninstalled we get errors. A third party extension lang zip is not usually a package type manifest but a file type manifest. See Hope it helps |
It's out of the scope of this PR as this is only about a bug in the uninstaller. The language packs generated by Crowdin are only how I detected it and the simplest way to test it. I could instead have written a custom package for a regular extension instead, but why do when I already have an example at hand 😄
They are not meant to be picked up by that. The download location for the files currently still is JC, and it will be an own server in the future (the same as for Joomla packages).
It's not about if the language packs are named correctly or if the XMLs are written properly. That's a different topic and something the translators have (and will) fix before releasing any pack. |
I have tested this item ✅ successfully on 2c7ce58
Anyway, this patch works, for the packs you posted as well as former format. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8089. |
I have tested this item 🔴 unsuccessfully on 2c7ce58 Local environment: http://de.joomlapbf.com Installation: Indonesian package: http://de.joomlapbf.com Installation: This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8089. |
@matrikular I see where that comes from. I have recently updated the source package file on Crowdin and the packages aren't upated yet to reflect that change. Thus the generated zips are broken as of now. |
...following for testing with another zip This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8089. |
@designbengel @matrikular You can try with this zip: www.bakual.ch/images/pr8089/bg.zip |
I have tested this item ✅ successfully on 2c7ce58 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8089. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8089. |
Allow folders in packages to be uninstalled like zips
Issue
The package installer allows to include the contained packages either as zip files or as plain folder.
All works fine when the extensions are contained as zips, but when you have them included as unpacked folders it installs fine, but doesn't get uninstalled together with the package.
For regular extensions, that isn't as much as an issue as you can still uninstall the extensions manually. However in the case of language packs, we have a special check there which enforces that language packs can only be uninstalled as package (don't ask me why). And thus when you uninstall a language package which contains admin and site as folders you will not be able to uninstall them.
So the following works both with install and uninstall:
while this only works for install:
Solution
This PR just adds folder tags to the "filelist" array in the package manifest builder. From there everything works again.
Testing
We found this issue while testing out Crowdin for creating the core language packages. Thus you can try one of the completed packages from there. Eg:
Indonesian: https://crowdin.com/download/project/joomla-cms/id.zip
Bulgarian: https://crowdin.com/download/project/joomla-cms/bg.zip
They should install fine, but when trying to uninstall the package, the actual language packs for site and admins aren't uninstalled.
After the PR is applied, they will be uninstalled together with the package as expected.
Obviously also try with a regular package that this still installs and uninstalls fine. You can use any of the official language packages (using the language manager) or a 3rd party extension package to test that.