I am trying to have my module alter menu_ui
functions. Changing my module's weight didnt help and I read that hook_module_implements_alter
is the way to go. So, as described here I am appending my module to the end of the implementations:
/**
* Implements hook_module_implements_alter.
*/
function mymodule_module_implements_alter(&$implementations, $hook) {
if ('form_alter' == $hook) {
$group = $implementations['mecca_hierarchy_access'];
unset($implementations['mecca_hierarchy_access']);
$implementations['mecca_hierarchy_access'] = $group;
}
}
But this just throws:
Uncaught PHP Exception RuntimeException: "An invalid implementation mymodule_form_alter was added by hook_module_implements_alter()" at /path/to/core/lib/Drupal/Core/Extension/ModuleHandler.php line 591
My form alter looks like this:
function mymodule_form_node_form_alter(&$form, FormStateInterface $form_state) {
// commented code
}
What do I do wrong?