Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.36k stars 2.76k forks source link

Bug: lang module doesn't load #6282

Closed dolibarr95 closed 7 years ago

dolibarr95 commented 7 years ago

Bug

If the module is not activated. The module name doesn't load.

Environment

Expected and actual behavior

I've got a some externals modules. When I disable one of them the name, his name doesn't display properly in the page /admin/modules.php. Instead of loading the text (in the module folder langs) Modulexx0001Name = My module name (xx is an unused module number : https://wiki.dolibarr.org/index.php/List_of_modules_id) it's display the value : $this->name = preg_replace('/^mod/i', '', get_class($this));

So, is it a normal behavior because the module is not active ? or a bug i don't know...

Steps to reproduce the behavior

Disable a module.

tks

rdoursenaud commented 7 years ago

Can't reproduce.

Could you first upgrade to the latest 4.0.3.

Have you considered that the bug might be in the module itself? Are all modules affected?

dolibarr95 commented 7 years ago

Hello

You're right everything is ok know (still 4.0.0). The error was here (in the module) : $this->langfiles = array("langfiles@anothermodule"); (in this case the lang files loads only if module is activated) instead of : $this->langfiles = array("anothermodule@anothermodule");

tks