Hi, I’m trying to develop a custom module using the built-in generator in Dolibarr, but I’m stuck because a menu item is not appearing.
I’ve already checked the module name, number, and possible errors, and everything seems correct. The module itself appears to work: the CSS/HTML changes I added are applied correctly and usable.
Normally, I enable the module from the “Modules/Applications” tab. However, in the “App/Module Generator” tab, the module’s toggle always appears as disabled. This made me think I needed to disable it from “Modules/Applications” and enable it from the generator tab instead.
After doing that, I noticed something confusing: clicking the toggle in the generator tab appears to have no visual effect (it stays on “disabled”), but in reality it does enable the module. I can tell because my CSS/HTML changes are applied again, and the module shows as enabled in the “Modules/Applications” tab.
Steps to reproduce:
- Enable the custom module from the “Modules/Applications” tab.
- Go to the “App/Module Generator” tab → the module toggle appears disabled.
- Click the enable switch → it still appears disabled (no visual change).
- Disable the module from the “Modules/Applications” tab.
- Click the enable switch in the generator tab → the module is actually enabled, but the toggle still appears disabled.
Additional observation:
It seems that clicking the toggle in the generator tab can only activate the module, not properly reflect or control its real state. This likely happens because the toggle relies on its own displayed state rather than the actual module status. As a result, the UI is misleading: even when the module is already enabled, the switch still appears disabled and behaves inconsistently.
At this point, I’m not sure if I’m doing something wrong or if this is a bug. What I’m certain of is that the behavior is inconsistent, and I’m concerned it may be related to the issue with the missing menu item.
Environment:
- Dolibarr version: 22.0.3
- OS: Ubuntu 24.04.4 LTS (x86_64)
EDIT:
I looked into the logs and found this error:
2026-04-01 09:41:48 ERR 151.47.201.72 2311 1000 DoliDBMysqli::query Exception in query instead of returning an error: Duplicate key name 'uk_richiestadocumenti_fk_object'
2026-04-01 09:41:48 ERR 151.47.201.72 2311 1000 DoliDBMysqli::query SQL Error message: DB_ERROR_KEY_NAME_ALREADY_EXISTS Duplicate key name 'uk_richiestadocumenti_fk_object' From /var/www/html/debugbar/class/TraceableDB.php:362.




