FIX 14.0: move splitting of module:submodule string out of the genallowed condition

This commit is contained in:
atm-florian 2023-01-11 17:31:37 +01:00
parent 81e39646ac
commit 356923b369

View File

@ -463,6 +463,15 @@ class FormFile
$titletoshow = ($title == 'none' ? '' : $title);
}
$submodulepart = $modulepart;
// modulepart = 'nameofmodule' or 'nameofmodule:NameOfObject'
$tmp = explode(':', $modulepart);
if (!empty($tmp[1])) {
$modulepart = $tmp[0];
$submodulepart = $tmp[1];
}
// Show table
if ($genallowed) {
$modellist = array();
@ -662,15 +671,6 @@ class FormFile
$modellist = ModelePDFUserGroup::liste_modeles($this->db);
}
} else {
$submodulepart = $modulepart;
// modulepart = 'nameofmodule' or 'nameofmodule:NameOfObject'
$tmp = explode(':', $modulepart);
if (!empty($tmp[1])) {
$modulepart = $tmp[0];
$submodulepart = $tmp[1];
}
// For normalized standard modules
$file = dol_buildpath('/core/modules/'.$modulepart.'/modules_'.strtolower($submodulepart).'.php', 0);
if (file_exists($file)) {