Joomla-cms: Installer plugin detection

Created on 29 May 2018  路  18Comments  路  Source: joomla/joomla-cms

Steps to reproduce the issue

Install and enable the install from web plugin
Disable all other install plugins

Expected result

Only install from web tab is displayed for Extensions->install

Actual result

Message displayed

No installation plugin has been enabled. At least one must be enabled to be able to use the installer. Go to the Plugin Manager to enable the plugins.

chrome_2018-05-29_11-10-29

J3 Issue No Code Attached Yet

Most helpful comment

I'll add it to my calendar, currently I'm booked out through June 2021 馃ぃ

All 18 comments

This is a major architectural fail.

When using the onInstallerViewBeforeFirstTab and onInstallerViewAfterLastTab events, plugins have to directly echo out the additional markup for the page. The IFW plugin doesn't return anything in these events, and isn't using the onInstallerAddInstallationTab event in the currently released version, so in this scenario the line that decides to show the error is basically checking a bunch of empty arrays.

To trick it into working there are two options:

1) Make a dodgy fix in the IFW plugin to return some dummy data in the plugin events and tag a new release
2) Finish up the improvements in the 4.0 branch, backport the work and tag a new release

yeah i just came to the same conclusion but thought of another option

Instead of trying to count the tabs why not count the number of enabled installer plugins

I don't know what else that plugin group is intended for, but not all of them may be adding tabs.

iirc that group was created by @roland-d just for managing what is displayed in the installer menu item. Before it was created they were all just one big file.

Doing a count of the enabled plugins is no more "hacky" than other solutions

Correct, I created the the plugin group for the installer plugins because non-existed. The IFW is the odd one out here since it works in a completely different way. We needed a plugin group as you otherwise can't enable/disable specific plugins. In my opinion the IFW should be reworked to use the plugin group as well, so all installation plugins work the same way.

As for the markup, I don't recall what was the issue but we had to do it that way. As far as I am concerned, we clean this up so all installer plugins work the same way.

All of that cleanup's already done in 4.0 via https://github.com/joomla/joomla-cms/pull/19319 so really it's just left to which of the handful of hacky solutions is going to "best" address this particular issue until it can be done properly.

My vote goes to your option 2.

I'll add it to my calendar, currently I'm booked out through June 2021 馃ぃ

:D I have my German university students at the end of July. I can take it on as a project for them. Is that an option?

Everything's an option if there are resources to make it happen. It's honestly not a lot of effort to do the backport and new release, just a lack of time and having to re-prioritize all the things on my part for a while now.

@roland-d is this still something you are going to be looking at with the students?

@brianteeman Yes, I just arrived today and we are starting tomorrow with the students.

great stuff - I guessed that might be the case

We have some students working on this now.

I was looking at the J4 code, and I believe we can remove the onInstallerViewBeforeFirstTab and onInstallerViewAfterLastTab triggers because ordering is based on the plugin ordering. These triggers were only introduced because IFW was not a normal plugin.

public function onInstallerAddInstallationTab()
{
$tab = array();
$tab['name'] = 'url'; // $tab['name'] = 'web';
$tab['label'] = Text::_('PLG_INSTALLER_URLINSTALLER_TEXT'); //$tab['label'] = Text::_('PLG_INSTALLER_WEBINSTALLER');

    ob_start();
    include PluginHelper::getLayoutPath('installer', 'urlinstaller');  //include PluginHelper::getLayoutPath('installer', 'webinstaller');
    $tab['content'] = ob_get_clean();
    return $tab;
}

}
maybe adding this in webinstaller.php can be help.
or just adding this empty method;

public function onInstallerAddInstallationTab()
{
return ['asd'];
}
@icampus

@roland-d agree

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/20608

closed as having Pull Request #21255

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilETaylor picture PhilETaylor  路  3Comments

brianteeman picture brianteeman  路  4Comments

alex7r picture alex7r  路  4Comments

Hils picture Hils  路  5Comments

MartijnMaandag picture MartijnMaandag  路  6Comments