I'm using Elgg 2.3.14 and need to override and comment/save action. I currently have a copy of the core comment/save.php located in my plugin directory which is /var/www/html/fc-plugin/actions/comment/save.php. I've added some custom 'system_message" strings in my plugin file near the beginning of the page to make sure they print out. I also added a 'system_message' line in the core ../actions/comment/save.php. The result that I'm seeing now when posting a comment is that I see the text I print in the core save.php and not my plugin save.php. Isn't this the correct way to override a core action file? What am I doing wrong here?
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 - 1 like
- TCB@tblack06
TCB - 0 likes
- TCB@tblack06
TCB - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- TCB@tblack06
TCB - 0 likes
You must log in to post replies.Did you add your action in start.php of your custom plugin:
Read more.
Did you add your custom 'system_message" strings in your languages/en.php?
Read more.
Flush the caches is required.
Ah.. simply forgot to register it. That was an oversight... thanks!
The custom messages that I need to print will be based on what comes back from a curl rest call. I'm trying to make sure I'm getting back the data I expect and wanted to simple display the json data that is returned.
$result = curl_exec($curl);
curl_close($curl);
$json = json_decode($result, true);
system_message('name is: '. $json->name );
This currently prints: 'name is: '
The data for the curl was run in Postman with results so I believe the setup is correct. I even tried to just create an arbitrary json object with fake data to try to print that the same way, but that failed as well.
I don't know what you try to do but the JSON output may be also as:
or
or even:
Learn more: https://www.json.org/example
Also, you can check it:
or full output:
Got it working. Thanks.