-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onExtensionBeforeSave and onExtensionAfterSave not working on plugins #7529
Comments
Can you propose a PR? See https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests if you need assistance in how to create one. @amazeika Is that related to #4308? Sounds at least like a similar issue. |
If I know the solution, I would not commit the issue without code. The code looks ok [in ./administrator/components/com_plugins/models/plugin.php the parent:save from JModelAdmin is called and that save method has the triggers]... but I don't know why they are not used... |
@Bakual Hello Thomas, these events are triggering just fine on my end when saving plugins. I've just reviewed the code and tried it myself. |
I tried it, too - again. I added this: public function onExtensionAfterSave($context, &$table, $isNew)
{
var_dump($context);
die(); // I know that die() isn't for debugging but it shows the best contrast (-> white site with a bit of text)
} to a standard core system plugin that is always activated: Logout (plugins/system/logout/logout.php) right after the constructor. |
Removing the If you look at your PHP log, you will see a warning like this:
|
That it was! Sorry. log_errors show more errors on Joomla, as only display_errors... For me the issue is closed. Thanks for your help. |
Steps to reproduce the issue
Search for e.g. „onExtensionAfterSave“ in Core-Files:
find . -type f -name "*.php" | xargs grep -sl "onExtensionAfterSave"
./administrator/components/com_modules/models/module.php
./administrator/components/com_plugins/models/plugin.php
./administrator/components/com_config/model/component.php
./administrator/components/com_templates/models/style.php
./administrator/components/com_languages/models/language.php
Now look for the trigger method in these files:
find . -type f -name "*.php" | xargs grep -sl "onExtensionAfterSave" | xargs grep -sl "trigger"
./administrator/components/com_modules/models/module.php
./administrator/components/com_config/model/component.php
./administrator/components/com_templates/models/style.php
./administrator/components/com_languages/models/language.php
Expected result
No trigger is used in ./administrator/components/com_plugins/models/plugin.php, but the config for a trigger is prepared. So now a developer cannot use the event on plugins but on all other types.
It would be better as a developer to be able to use that event on plugins, too.
The text was updated successfully, but these errors were encountered: