Actions in new version

  1. 7 years ago
    Edited 7 years ago by alex21

    Created a plugin. Need to assign new action.
    In old version it looked like

    public function userController_actionname($sender)

    But now it redirects to main page. How can I implement this functionality now?

    Thanks.

  2. Toby

    6 Aug 2012 Administrator
    Edited 7 years ago by Toby

    I think there may be a bug preventing this.

    Check out around line 251 in lib/functions.general.php. This is just where we work out if the controller will be able to handle the method down the track. It is consistent with the format you posted above (userController_method).

    if (method_exists($plugin, $c."Controller_".$method)) {

    Now check out the dispatch function in lib/ETController.class.php (line 160). This is where the method in the plugin class is actually called. But it uses the event system (ET::trigger), so the method name will be prefixed with "handler_". i.e. handler_userController_method.

    Try changing line 251 in lib/functions.general.php to:

    if (method_exists($plugin, "handler_".$c."Controller_".$method)) {

    and see if that fixes it?

    Wow, it's been a while since I looked at esoTalk's code... :P

 

or Sign Up to reply!