No Code Attached Yet
avatar svanschu
svanschu
17 Jun 2024

Steps to reproduce the issue

Install a plugin and try to access $parent-extension in preflight

Expected result

Getting the information about the current installed plugin

Actual result

null

System information (as much as possible)

URL j5.2-dev PluginAdapter

protected function checkExistingExtension()

    protected function checkExistingExtension()
    {
        try {
            $this->currentExtensionId = $this->extension->find(
                ['type' => $this->type, 'element' => $this->element, 'folder' => $this->group]
            );
        } catch (\RuntimeException $e) {
            // Install failed, roll back changes
            throw new \RuntimeException(
                Text::sprintf(
                    'JLIB_INSTALLER_ABORT_ROLLBACK',
                    Text::_('JLIB_INSTALLER_' . $this->route),
                    $e->getMessage()
                ),
                $e->getCode(),
                $e
            );
        }
    }

URL j5.2-dev InstallerAdapter

if ($this->currentExtensionId) {

protected function checkExistingExtension()
    {
        try {
            $this->currentExtensionId = $this->extension->find(
                ['element' => $this->element, 'type' => $this->type]
            );

            // If it does exist, load it
            if ($this->currentExtensionId) {
                $this->extension->load(['element' => $this->element, 'type' => $this->type]);
            }
        } catch (\RuntimeException $e) {
            // Install failed, roll back changes
            throw new \RuntimeException(
                Text::sprintf(
                    'JLIB_INSTALLER_ABORT_ROLLBACK',
                    Text::_('JLIB_INSTALLER_' . $this->route),
                    $e->getMessage()
                ),
                $e->getCode(),
                $e
            );
        }
    }

Additional comments

If you do the same for a extension, then $parent-extension is available in preflight because checkExistingExtension of InstallerAdapter loads the extension information.

PluginAdapter does not load the extension Information within checkExistingExtension.

Shouldn't load the PluginAdapter the plugin information like it is done by the InstallerAdapter for extensions?

avatar svanschu svanschu - open - 17 Jun 2024
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jun 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Jun 2024
avatar svanschu svanschu - change - 17 Jun 2024
The description was changed
avatar svanschu svanschu - edited - 17 Jun 2024
avatar svanschu svanschu - change - 18 Jun 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-06-18 19:22:00
Closed_By svanschu
avatar svanschu svanschu - close - 18 Jun 2024

Add a Comment

Login with GitHub to post a comment