Open ouch67 opened 3 weeks ago
Hello,
Thanks for your investigations. Can you make a PR ?
I do not have git at work but you only need to change line 198 of import.class.php from the main branch to:
if (!preg_match("/^(mod.*)\.class\.php$/i", $file, $reg)) {
Essentially just adding the '$' after '.php'
Bug
When creating a new module in Dolibar v19.0.2 and setting an import profile in the module's modX.class.php it gets duplicated on the import step 1 screen. This happens because the built in file editor creates a backup file and the import.class.php file has an incorrect file filter set.
import.class.php Line 117 currently looks like this:
/^(mod.*)\.class\.php/i
It needs a $ added after .PHP to look like:/^(mod.*)\.class\.php$/i
This would bring this module to match export.class.php line 128's class file filter. Which does not have any issues.
Dolibarr Version
19.0.2
Environment PHP
8.2.21
Environment Database
posgresql 16
Steps to reproduce the behavior and expected behavior
No response
Attached files
No response