?
avatar joeforjoomla
joeforjoomla
11 Mar 2019

Steps to reproduce the issue

Uninstall an extension on Joomla 4

Expected result

Extension is uninstalled correctly

Actual result

Error 'Too few arguments' passed to the function 'onExtensionBeforeUninstall' of the new plugin 'extension/finder/finder.php'

Additional comments

Additionally i ignore the purpose of this plugin

avatar joeforjoomla joeforjoomla - open - 11 Mar 2019
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Mar 2019
avatar infograf768
infograf768 - comment - 11 Mar 2019

Looks like the code is wrong in /libraries/src/Installer/Installer.php line 756-761.
We have

		// Fire the onExtensionBeforeUninstall event.
		PluginHelper::importPlugin('extension');
		Factory::getApplication()->triggerEvent(
			'onExtensionBeforeUninstall',
			array('eid' => $identifier)
		);

Looks like it should be

		// Fire the onExtensionBeforeUninstall event.
		PluginHelper::importPlugin('extension');
		Factory::getApplication()->triggerEvent(
			'onExtensionBeforeUninstall',
			array('installer' => clone $this, 'eid' => $identifier, 'removed' => $result)
		);

Can you test?

The plugin is used to add or remove common words of a language from com_finder

avatar infograf768
infograf768 - comment - 11 Mar 2019

btw, which extension do you try to uninstall?

avatar joeforjoomla
joeforjoomla - comment - 11 Mar 2019

Yes @infograf768 if you pass the correct parameters to the onExtensionBeforeUninstall event obviously it works. The issue at the moment occurs with whatever extension/plugin you are trying to uninstall.
However i still have not clear what's the reason of executing such a plugin to remove common words of a language from com_finder, for example when installing/uninstalling a simple system plugin that has nothing to do with com_finder.
To me this sounds a bit not logical and redundant,

avatar infograf768
infograf768 - comment - 11 Mar 2019

Let me make a patch for the error.
Concerning finder, absolutely no idea.

@Hackwar should know better.

avatar joeforjoomla
joeforjoomla - comment - 11 Mar 2019

Maybe i've understood the purpose looking better at the code. This is something that relates to language extensions only. IMHO it would be better to check immediately at the beginning of onExtensionAfterInstall, onExtensionBeforeUninstall, etc if the extension is of type language, instead of execute a database query. I see a large margin of improvements in this plugin.

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Mar 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 11 Mar 2019

Patch here
#24159

Closing.
Please create a new issue specifically for the Extension- Finder plugin. I have no idea what is a language extension plugin.

avatar infograf768 infograf768 - close - 11 Mar 2019
avatar infograf768 infograf768 - change - 11 Mar 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-03-11 15:26:35
Closed_By infograf768
avatar infograf768 infograf768 - change - 11 Mar 2019
Status Closed New
Closed_Date 2019-03-11 15:26:35
Closed_By infograf768
avatar infograf768 infograf768 - reopen - 11 Mar 2019
avatar infograf768
infograf768 - comment - 11 Mar 2019

I reopen. The issue may be in the plugin itself. It's the only one though using this event.

avatar alikon
alikon - comment - 11 Mar 2019

please test #24162

avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2019
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 11 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Mar 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-03-11 17:33:42
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 11 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 11 Mar 2019

closed as having Pull Request #24162

avatar SharkyKZ
SharkyKZ - comment - 11 Mar 2019

Test PR #24163 please.

Add a Comment

Login with GitHub to post a comment