Closed prh47bridge closed 2 years ago
@nikosdion Is this the same issue as #38956 ?
@richard67 Yup! This is the same problem. In my issue I have explained why it happens, at least to the point where I could reproduce it. As @prh47bridge said and I had also explained in my ticket, this only happens when you try to update a package together with a non-package extension in the same request.
This must've been happening for years but nobody noticed because there was no type hinting in the installation scripts. Even if someone implements \Joomla\CMS\Installer\InstallerScriptInterface
they will not see the problem as it only type hints InstallerAdapter. When a developer type hints the accurate adapter type, e.g. \Joomla\CMS\Installer\Adapter\PackageAdapter
, the problem becomes evident. Eventually this will happen and people will complain that Joomla does not let them update any extension.
Closing as duplicate report. See #38956 . Thanks for reporting.
I don't know if this is limited to my system or a more general problem.
When I updatee an extension with a preflight or postflight script, the updatee will fail complaining that the script has been passed a LibraryAdapter instead of a PackageAdapter. However, if I install the updatee by downloading the package and installing it in the normal way (i.e. as if it was a fresh install rather than an update), everything works fine.
I have two such extensions - Akeeba Backup and JCH Optimize, both of which experience this problem. The developer of one of these extensions suggested that this was a database issue - that the extension was recorded in the database as a library instead of as a package. However, I have checked the database and both are showing as packages. Neither includes a library.
Extension updates worked fine for these extensions when I initially upgraded to Joomla 4. They have stopped working at some point since then.
I am running Joomla 4.2.4 using PHP 8.1.12.
Any assistance with resolving this issue would be much appreciated.