### Steps to reproduce the issue
Still 'No Problems' with the data table structure
Result for 'Visforms - Limit number of submissions' shows 'One Problem'
Tested with php7.4 and 8.0 on different environments
Clean Joomla 4.0 and 4.1 with no additional extensions except the plugin
The problem is cause by by the function fixUpdateVersion in administrator/components/com_installer/src/Model/DatabaseModel.php on line 635ff which does not take into account, that the path to a plugin and it's installation manifest xml is more complex and different form components. (Same statement would be correct for modules, by the way)
As a result, the installation manifest file is not found and the value of the 'version' property in the 'manifest_cache' of the plugin in the table #__extensions is actively and wrongly set to an mpty string.
I've tested the following fix, which seems to work fine.
File: administrator/components/com_installer/src/Model/DatabaseModel.php
After Line 646: Add custom code for plugin, which store there installationXML files in subfolders and under JPATH_SITE
else if ($table->get('type') === 'plugin') {
$installationXML = InstallerHelper::getInstallationXML($table->get('element'), $table->get('type'), 0, $table->get('folder'));
$extensionVersion = (string) $installationXML->version;
}
A quick fix would be highly appreciated. A correct version value in the the 'manifest_cache' is really important and an invalid or empty value can really crash the installation/update process of extensions.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Title |
|
@avjoomla I think it can be done a little bit easier. Just change line 649 to:
$installationXML = InstallerHelper::getInstallationXML($table->get('element'), $table->get('type'), $table->get('client_id'), $table->get('element') === 'plugin' ? $table->get('folder') : null);
That should fit for all kinds of extensions.
That's how it's done at a few other places in the same file.
I will prepare a PR in a while.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-01 09:10:27 |
Closed_By | ⇒ | richard67 |
Status | Closed | ⇒ | New |
Closed_Date | 2022-03-01 09:10:27 | ⇒ | |
Closed_By | richard67 | ⇒ |
Re-opening since the patch is not ready yet, still work in progress.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-01 10:37:44 |
Closed_By | ⇒ | richard67 |
I tested with your patch and the fix works. Thanks for taking care of this issue.
@avjoomla Could you mark your test result in the issue tracker here https://issues.joomla.org/tracker/joomla-cms/37160 by using the "Test this" button at the top left corner, then selecting the right test result and submitting? Thanks in advance.
Hi @richard67
I'm experiencing the same kind of issue for components. I have a package including a plugin and a component. In my case, 'Update Structure' in Maintenance:Database for the component sets the value of the extension version in manifest_cache to an empty string. The plugin version doesn't have any issue though.
And it shows this warning:
Notice: Trying to get property 'version' of non-object in C:\laragon\www\joomla406\administrator\components\com_installer\src\Model\DatabaseModel.php on line 570
This issue occurs only in Joomla 4x (tested in 4.0.6 & 4.1.5), in Joomla 3x, everything is fine.
Any way to solve this?
Please edit the title so that it has some relative meaning