-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Library installer runs manifest uninstall sql file when updating #35083
Comments
This comment was marked as abuse.
This comment was marked as abuse.
This is an bug in the installer for libraries in all versions of Joomla. You can work around it by changing it to type=file. I dont know if it has ever been reported as a bug
|
This comment was marked as abuse.
This comment was marked as abuse.
Sadly, I don't find it funny. The mechanism used to upgrade libraries actually makes it near impossible to have an installation script at all. The problem being that the script is loaded twice, once for the uninstall and once for the install. Because it is loaded from different places, PHP doesn't recognise it as the same thing. Consequently there is a compile error because of the duplicate declaration of the installation script class. In the absence of almost any documentation, I'm not clear how a "file" extension is a viable alternative. Does any relevant documentation exist? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35083. |
Steps to reproduce the issue
Updating a library - as a single entity or as part of a package - whose library manifest.xml includes an uninstall-sql-markup. I used drag & drop file upload and install from a folder.
Example of a manifest xml for a library, that leads to the problem:
Expected result
The uninstall sql file content should not be executed at all when updating the library. Only when uninstalling it.
Actual result
The uninstall sql script is executed, and leads in our case to a "drop table" because the statement is written in there.
System information (as much as possible)
Joomla 4.0 RC 5
Additional comments
In Joomla 3.9.28 the update is not executing the uninstall sql file. What is correct. But the unintall sql script is not called when uninstalling the library either. This would become a different ticket I suppose.
The text was updated successfully, but these errors were encountered: