No Code Attached Yet J4 Issue
avatar PhilETaylor
PhilETaylor
7 Oct 2020

Steps to reproduce the issue

In Joomla 4 the Extension - Namespace Updater plugin has text:

Warning! This plugin must be enabled as it runs on extension install, update and deletion.

However it is totally possible to disabled it ! :-)

Screenshot 2020-10-07 at 01 21 30

Expected result

In ability to disable this plugin like it states, or better language that explains what will happen if its disabled and why that's bad enough to scare me to never disable it (also noting that I could disable it in the plugin list view with a single click and never see this warning!)

Actual result

This plugin can be disabled.

avatar PhilETaylor PhilETaylor - open - 7 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 7 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Oct 2020
avatar brianteeman
brianteeman - comment - 24 Oct 2020

Not really any different to authentication plugins

avatar PhilETaylor
PhilETaylor - comment - 24 Oct 2020

Authentication plugins are designed to be enabled or disabled at the will of the site admin. They are optional plugins.

This Namespace Updater plugin, by its own admission, is designed never to be disabled.

avatar richard67
richard67 - comment - 24 Oct 2020

@wilsonge Is it true? Has this plugin to be always enabled? If so, I can make a PR to fix the "protected" value for that plugin. Or is just that text wrong and in fact it CAN be disabled when only using namespaced extensions?

avatar zero-24
zero-24 - comment - 24 Oct 2020

Is it true? Has this plugin to be always enabled? If so, I can make a PR to fix the "protected" value for that plugin. Or is just that text wrong and in fact it CAN be disabled when only using namespaced extensions?

I would say go with the protected step for now as this seems to be required even for namespaced extensions.

avatar brianteeman
brianteeman - comment - 24 Oct 2020

Sorry to clarify - with the authentication plugins there is a similar message warning you that you must have one authentication plugin enabled. I assumed that it would be the same here that a user might want/need to use a different namespace plugin

I would say go with the protected step for now as this seems to be required even for namespaced extensions.

Really? My quick test doesnt have any problem with it disabled

avatar zero-24
zero-24 - comment - 24 Oct 2020

Really? My quick test doesnt have any problem with it disabled

Have you installed an extension that uses its own namespaces?

Sorry to clarify - with the authentication plugins there is a similar message warning you that you must have one authentication plugin enabled. I assumed that it would be the same here that a user might want/need to use a different namespace plugin

hmm I hardly see anyone using a different namespace update plugin.

avatar richard67
richard67 - comment - 24 Oct 2020

Sorry to clarify - with the authentication plugins there is a similar message warning you that you must have one authentication plugin enabled.

A "one of n" rule for "enabled" we can't force with the "protected" column of the extensions table in database.

avatar richard67
richard67 - comment - 24 Oct 2020

My knowledge on namespace mapping is too little, so I wait for instructions. I am the database guy who can make the necessary SQL. But I'd prefer to have feedback from @wilsonge .

avatar brianteeman
brianteeman - comment - 24 Oct 2020

Daft question perhaps but if this has no options and it must always be enabled why is it even a plugin

avatar zero-24
zero-24 - comment - 24 Oct 2020

I agree seems @yvesh had the same idea in the intial version too:

As when the plugin is not enabled this can break the entire site, we should reevaluate protecting plugins / extensions OR move it to the installer etc.

#16403

avatar jwaisner jwaisner - change - 2 Nov 2020
Labels Added: J4 Issue
avatar jwaisner jwaisner - labeled - 2 Nov 2020
avatar wilsonge
wilsonge - comment - 18 Dec 2020

I did consider just hard adding this into the events system to be honest. But generally most people prefer an approach of having customisation.

As mentioned this plugin is basically responsible for regenerating the namespace map files when extensions using namespaces (there will only be a few to start with I assume) are installed/updated. If extensions rely on autoupdating then this plugin needs to exist.

avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-03-06 22:25:10
Closed_By PhilETaylor
Labels Added: No Code Attached Yet
Removed: ?
avatar PhilETaylor PhilETaylor - close - 6 Mar 2022
avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

The plugin can still be disabled today, however, even when disabled, if the autoload_psr4.php is deleted, Joomla will still regenerate it on first page load - and not crash the site as it used to.

The ability then to disable the plugin is correct - and a configurable part of Joomla - that allows an admin to control if the mapping is updated on install/uninstall of extensions.

Of course you would be mad to disable it - but the option is there - what has been fixed since this issue was open, was the complete crashing of the site if autoload_psr4.php was not available, now, Joomla silently recreates it on first page load.

Add a Comment

Login with GitHub to post a comment