In the German forum we were informed of the following:
When an extension is uninstalled (doesn't happen for normal plugins/modules) following message appears:
"An attempt is being made to uninstall an unknown extension from the package. However, it may have already been removed beforehand."
Either you should be informed WHICH extension could not be uninstalled, or the message should not appear at all.
see above
Joomla 4.4.1
PHP 8.2
The following has already been done:
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
@ChristineWk The English message in the description of the issue, has that been translated from German? The only language string which I can find which could be the one is this one in the "lib_joomla.ini" in the administrator language:
JLIB_INSTALLER_ERROR_PACK_UNINSTALL_UNKNOWN_EXTENSION="Trying to uninstall unknown extension from package. This extension may have already been removed earlier."
There is another one in the same language file where the extension would be known and be part of the message (%s
):
JLIB_INSTALLER_ERROR_PACK_UNINSTALL_NOT_PROPER="Package Uninstall: This extension may have already been uninstalled or might not have been uninstalled properly: %s"
It needs to check PHP code where these strings are used to see why in case of the first string the extension is not known and if that can be fixed somehow.
Ok, the string in question is only used in the "libraries/src/Installer/Adapter/PackageAdapter.php" file in method "removeExtensionFiles". That method goes through all files in the <files>
element of the package's manifest file and checks in database if the correspnding extension exists. If that is not the case (no extension ID found), it reports that string. This could be extended or fixed by reporting also the parameters for which it tried to find the extension.
E.g. for the first example <file type="component" id="com_helloworld" >com_helloworld.zip</file>
in the package manifest documentation here https://docs.joomla.org/Package it would be:
We could create a new language string which contains these details for that case and deprecate the old string.
Or maybe it would be sufficient just to add the name (attribute "id"), e.g. "com_helloworld". I have to check if that attribute is mandatory so it can be used in all cases.
I will see if I can make a PR soon.
Some information in addition to @chmst 's correct explanation why this can happen:
In old times before we had packages it was the responsibility of a component to uninstall any corresponding extensions like plugins or modules, and the components handled that with their installer script.
Now as we have packages it would be sufficient just to uninstall the package when the package is made right.
But some popular 3rd party components which I know still do it the old way, so when you uninstall the component (or uninstall the package and that comes to the component), then the component uninstallation also uninstalls other extensions, and then when later the package is uninstalled, these extensions are already gone.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-12-26 14:52:26 |
Closed_By | ⇒ | richard67 |
Thanks for reporting I see this warning frequently and agree that it is not really useful. It appears when some parts of a package are deinstalled before the whole package. In general, this should not be possible, but sometimes extensions also are removed by the user directly, or there are older extensions. It would be helpful if the name of the missing element could be shown