Override thewire/add

Hi,

I seem to be overlooking something when attempting to override the 'add' action of thewire plugin.  In my plugins start.php init function I have:

elgg_register_action('thewire/add', __DIR__, . '/actions/thewire/add.php');

I have copied the ../vendor/elgg/elgg/mod/thewire/actions/add.php to my /var/www/html/mod/myplugin/actions/thewire/ directory and given all of the appropriate permissions on the file.  I've added a few debug lines near the top of the file just to see if the action is registered correctly, but whenever I go to post a wire it seems my action isn't getting hit.  Any help would be appreciated.  I'm using elgg 2.3.14.

 

 

  • Try this:

    elgg_register_action('thewire/add', __DIR__ . '/actions/thewire/add.php');

    Hint: Check your server's error log before creating new discussion.

  • RvR sorry for the confusion... I actually typed it incorrectly in my post.  I didn't actually have that extra ','  after __DIR__ in my code :-|.  There are no errors in my server log.. I actually wish it was just a typo.

    elgg_register_action('thewire/add', __DIR__ . '/actions/thewire/add.php');

  • Ok. In this case try to do it:

    1 - Place your plugin after 'thewire' plugin (via Plugins in Administration)

    2 - Add additional hook in your start.php before registering custom action:

    elgg_unregister_action('thewire/add', elgg_get_plugins_path() . 'thewire/actions/add.php');

    3 - Run 'Flush the caches'

  • ahhhhh... ok I will give that a try.

  • That worked.. thanks.. gotta remember that part about moving up the plugin.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking