Joomla-cms: onExtensionBeforeSave/onExtensionAfterSave not fired when saving Global Config

Created on 19 Jun 2016  路  7Comments  路  Source: joomla/joomla-cms

Steps to reproduce the issue

Save the global Config - check which triggers are called, note that the onExtensionBeforeSave/onExtensionAfterSave triggers are not fired, whereas if you are saving the configuration of any "component" with com_config then those triggers are fired.

This therefore is inconsistent and should be changed.

see here for the current triggers:
https://github.com/joomla/joomla-cms/search?utf8=%E2%9C%93&q=onExtensionBeforeSave

Expected result

When saving Joomla Global Config I expect onExtensionBeforeSave/onExtensionAfterSave to be triggered before and after configuration.php is written

Actual result

No triggers are fired

System information (as much as possible)

Joomla 3.6.0beta2 and below.

No Code Attached Yet

All 7 comments

I would not reuse the onExtensionBeforeSave/onExtensionAfterSave events as they are only used when extensions are saved as your search query is showing it. I agree that it would make sense to trigger some events, but with a different name. The parameters would be different as well, because when the global configuration is saved, different actions are performed, like saving the permissions, filters and the configuration.php file.

com_config is "just another extension" and its data should be treated in the same way as other extensions and should be firing the correct triggers.

I actually kind of agree here about the event name. Since we decided to go with context aware event names (onContent*Save, onExtension*Save, onUser*Save), contextually the global configuration should have a separate event. True, the firing context is within com_config and it's "just another extension", but IMO it'd be better to assign the context based on the data being manipulated (in this case the global configuration, not something from an extension) versus the firing context.

Then again, I think it'd be better if we just had generic BeforeSave and AfterSave events and used additional arguments (like the context parameter we pass around) to specify what data is being saved instead of trying to contextify the event names AND provide a context parameter.

Is there any code coming?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10867.

No code forthcoming due to other commitments, this is just highlighting another area of inconsistent api use in Joomla :(

Guyz we need to get this working, specially since configuration.php is overwritten every time someone saves the config. For some special use case I needed to manually update the config.

@cyberguroo can you please open a new Issue as Comments on closed Issues didn't get much Notice, thanks.

Was this page helpful?
0 / 5 - 0 ratings