Skip to content
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.4] Poor information when uninstalling a package #42537

Closed
ChristineWk opened this issue Dec 17, 2023 · 5 comments
Closed

[4.4] Poor information when uninstalling a package #42537

ChristineWk opened this issue Dec 17, 2023 · 5 comments

Comments

@ChristineWk
Copy link

Steps to reproduce the issue

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."

Expected result

Either you should be informed WHICH extension could not be uninstalled, or the message should not appear at all.

Actual result

see above

System information (as much as possible)

Joomla 4.4.1
PHP 8.2

Additional comments

The following has already been done:

  • Components folder checked
  • DB root checked
  • DB table Extensions checked
  • Debug mode "unfortunately" does not throw a call stack either
@chmst
Copy link
Contributor

chmst commented Dec 18, 2023

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

@richard67
Copy link
Member

richard67 commented Dec 26, 2023

@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.

@richard67
Copy link
Member

richard67 commented Dec 26, 2023

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:

  • type = "component"
  • id (or better "name") = "com_helloworld"
  • file = "com_helloworld.zip"
  • in case of modules also client = administrator or site.

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.

@richard67
Copy link
Member

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.

richard67 added a commit to richard67/joomla-cms that referenced this issue Dec 26, 2023
Better message on package uninstallation when an extension from that package is missing. Fixes issue joomla#42537 .
@richard67
Copy link
Member

Closing as having a pull request. Please test #42570 . Thanks in advance.

MacJoom pushed a commit that referenced this issue Dec 27, 2023
Better message on package uninstallation when an extension from that package is missing. Fixes issue #42537 .
Razzo1987 added a commit that referenced this issue Jan 4, 2024
* Fix link and button colors in header footer (#42504)

* [4.x] add php 8.3 to tests (#42545)

* Update the signature for #42545 (#42552)

* [4.4] Joomlaupdate remove br tag from language strings - follow up to PR 42489 (#42550)

* Better English (1)

* Better English (2)

* Remove br html element from language strings

* Fixes to form validation process (#42560)

Fixes hardening measure introduced in #23716

* [4][com_actionlogs] missed load plugin languages (#42562)

* load lang

* test-4-dupkey

* Better message on package uninstallation (#42570)

* Better message on package uninstallation when an extension from that package is missing. Fixes issue #42537 .

* backport #41865 (#42088)

* backport [5] update from nightly to latest nightly build #41865

* [5] harmonize naming task types (#42574)

* [5.0] colour contrast in media manager file list [a11y] (#42544)

* [5.0] Update phpseclib to 3.0.34 (#42469)

* Fix `function` parameter lost during redirect (#42315)

* Fix `function` parameter lost during redirect

* Move function parameter to form url

* Remove hidden input

* [4.4] Fix SQL error "1104 The SELECT would examine more than MAX_JOIN_SIZE rows" when checking for core updates (#42576)

* Use concat of columns for getting core extensions

* Fix PHPCS

* Remove wrong quotes

* Revert min version in drone (#42583)

* Joomla! 5.0.2 Release Candidate 1

* Revert to dev

* [4][com_templates] cast to int for pgsql (#42569)

* cast to int for pgsql

* yet-another

* patch article tags (#42486)

* Joomla 5.0.2 Release Candidate 2

* Reset to dev

* Update signature HMAC in .drone.yml

---------

Co-authored-by: Rick Spaan <[email protected]>
Co-authored-by: Christian Heel <[email protected]>
Co-authored-by: Allon Moritz <[email protected]>
Co-authored-by: Richard Fath <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: George Wilson <[email protected]>
Co-authored-by: Nicola Galgano <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>
Co-authored-by: David Jardin <[email protected]>
Co-authored-by: janschoenherr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants