I have a plugin and would like to override the save.php action located in the blog module at:
/var/www/html/vendor/elgg/elgg/mod/blog/actions/blog
Can you override this action in the same manner as overriding a core action since it's part of a module? Register the action in my start.php with path:
/var/www/html/mod/my-plugin/mod/blog/actions/blog/save.php? I don't want to recreate the blog just update that action.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- TCB@tblack06
TCB - 0 likes
- TCB@tblack06
TCB - 0 likes
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- TCB@tblack06
TCB - 0 likes
You must log in to post replies.Sure.
Elgg 2.x: http://learn.elgg.org/en/2.3/guides/actions.html#registering-actions
Elgg 3.x: http://learn.elgg.org/en/3.x/guides/actions.html#registering-actions-using-plugin-config-file
You custom action must be located in:
thanks
So I've added to my start.php:
elgg_register_action('mod/blog/actions/blog/save', __DIR__ . '/actions/blog/save.php');
and added some system_message statements at the beginning of my action file to display when this action is triggered but doesn't seem to be recognizing my file. I've also tried to modify the core action located in my elgg installation directory at:
/var/www/html/vendor/elgg/elgg/mod/blog/actions/blog/save.php
added some system_message statements when I know the blog post saved successfully like:
system_message(elgg_echo('blog:message:saved'));
system_message('custom message');
but, my custom message never printed so I'm not sure why even my changes in the core action aren't being recognized. Seems like I'm overlooking something simple here... but haven't yet figured it out.
Please read the documentation on how to correctly register an action.
it should be
Thanks Jerome.. I did read the docs but I was a little confused about how to override an action that is part of a bundled plugin. I wasn't sure if it was the same as registering a new action from scratch.