Merge pull request #23515 from ATM-Consulting/FIX_14_pdf_download_fails_submodule

FIX 14.0: move splitting of module:submodule string out of condition
This commit is contained in:
Laurent Destailleur 2023-01-11 20:15:03 +01:00 committed by GitHub
commit 15e64c12aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,6 +449,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();
@ -648,15 +657,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)) {