Custom Menu Handler Not Called in v22 Despite All Checks Passing

I am trying to create a custom left menu for my module (myreports) in Dolibarr v22 using a lib.php handler, but it is not appearing. The top menu for the module appears correctly, but the handler function is never called.

We have performed exhaustive debugging and have confirmed the following:

  1. Database Record: The top menu entry in the llx_menu table is correct and contains the trigger 'leftmenu' => 'myreportsindex'.
  2. Activation: The $mainmenu = 'myreports' global variable is correctly set in the page file before llxHeader is called.
  3. Handler File Integrity: A standalone test script has proven that the handler file (myreportsindex.lib.php) exists, is readable by the web server, and has no fatal PHP syntax errors.
  4. Module Cache: The module has been repeatedly disabled and re-enabled to refresh the database entries.

Despite all components being individually correct and verifiable, the core menu engine (print_left_eldy_menu) is failing to include and execute the handler file. This seems to point to a deeper environmental issue or a potential bug. Any ideas would be greatly appreciated.

Have you put the dolibarr.log file into the debug log mode? - does it give any hints?

Hi, yes I did and it shows no errors.

It seems that Dolibarr isn’t invoking the leftmenu handler at all, at least in my v22 instance.

Should I assume this is a bug?
Tks

You can try filing one here GitHub · Where software is built

Tks! I will do.