User tests: Successful: Unsuccessful:
Pull Request for Issue #38840 .
Gracefully handle error on module uninstallation due to error in module XML manifest file.
$clientPath = ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE);
$source = $path ?: $clientPath . '/modules/' . $extension;
... existing ...
$client = (string) $this->getManifest()->attributes()->client;
if (strlen($client))
{
$this->doLoadLanguage($extension, $source, \constant('JPATH_' . strtoupper($client)));
}
else {
$this->doLoadLanguage($extension, $source, $clientPath);
}
Install a module with this in the manifest:
Instead of:
Then try to uninstall it.
Uninstallation fails.
Get error Undefined constant "JPATH_"
1 () JROOT\libraries\src\Installer\Adapter\ModuleAdapter.php:370
2 constant() JROOT\libraries\src\Installer\Adapter\ModuleAdapter.php:370
3 Joomla\CMS\Installer\Adapter\ModuleAdapter->loadLanguage() JROOT\libraries\src\Installer\Adapter\ModuleAdapter.php:525
4 Joomla\CMS\Installer\Adapter\ModuleAdapter->setupUninstall() JROOT\libraries\src\Installer\InstallerAdapter.php:1150
5 Joomla\CMS\Installer\InstallerAdapter->uninstall() JROOT\libraries\src\Installer\Installer.php:875
6 Joomla\CMS\Installer\Installer->uninstall() JROOT\administrator\components\com_installer\src\Model\ManageModel.php:262
This is due to missing client="site" in module manifest.
Uninstallation succeeds.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
@BrainforgeUK It seems the description is missing some details which are not shown because they contain code or markup. Please quote them so that they are shown, otherwise no reader understands the description of this PR.
Labels |
Added:
PR-4.3-dev
|
Tabs removed and pull request description improved.
@BrainforgeUK The pull request description still does not show your code because you haven't quoted it into `` quotes.
P.S. You also haven't made a selection among the check boxes if there are documentation changes required or not.
Labels |
Added:
bug
?
|
What's happending with this pull request?
as usual, it needs 2 successful tests, and/or a RL decision
also
can you please have a look at https://ci.joomla.org/joomla/joomla-cms/66125/1/8
Title |
|
Does this require any action on my part?
This pull request has been automatically rebased to 4.4-dev.
Title |
|
This pull request has been automatically rebased to 5.2-dev.
Title |
|
Can you please fix the conflict?
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-18 08:31:07 |
Closed_By | ⇒ | joomdonation | |
Labels |
Added:
Small
PR-4.4-dev
PR-5.2-dev
Removed: PR-4.3-dev ? |
Thanks @BrainforgeUK for the PR. As mentioned by @heelc29, the issue was fixed by the already merged PR #36692 (the code is a bit different, but fixed the same issue when client attribute is missing from the module).
For that reason, I'm closing this PR. Feel free to re-open it if needed.
Thanks !
@BrainforgeUK Please fix the code style errors reported by drone here: https://ci.joomla.org/joomla/joomla-cms/58326/1/8 . We meanwhile use spaces (4 for each level) for indentation and not tabs like in past.