Hello there,
I'm currently working on an action plugin, which allows users to create personal bookmarks via a button in the pagetools. While I managed to insert the MenuItem, as an child of the AbstractItem-Class, to the pagetools, I seem to have issues adding its functionality.
The class of my plugin is called "action_plugin_favorites", located in action.php.
I used two hooks, one to manipulate the pagetools and the second to add functionality to the button:
$controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, 'handle_menu_items_assembly', array());
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'saveFavorite');
In MenuItem.php I declared the type as 'action_plugin_favorites'.
The, to me, strange part is when I click the button, Dokuwiki throws an error: "Action Unkown: action_plugin_favorites", yet it calls the "saveFavorite"-function correctly. I don't know if it helps, but here is the definition of the function:
public function saveFavorite(Doku_Event $event, $param){ }
Can someone give me directions on how to resolve the error message?
Thanks in advance 🙂