2
0
forked from Wavyzz/dolibarr

Fix download of zip should be ok if no installmodule.lock file exists

This commit is contained in:
Laurent Destailleur
2025-10-01 01:02:21 +02:00
parent 1427895a62
commit 4d5d72cdb5

View File

@@ -364,8 +364,9 @@ if ($mode == 'desc') {
$tmpdirofmoduletoshow = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', (string) $dirofmodule);
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $tmpdirofmoduletoshow);
$installmoduleslock = DOL_DATA_ROOT.'/installmodules.lock';
global $dolibarr_allow_download_external_modules;
if (!empty($dolibarr_allow_download_external_modules) && preg_match('/\/custom\//', (string) $dirofmodule)) {
if ((!file_exists($installmoduleslock) || !empty($dolibarr_allow_download_external_modules)) && preg_match('/\/custom\//', (string) $dirofmodule)) {
// Add a link to download a zip of the module
$textexternal .= ' <a href="'.DOL_URL_ROOT.'/admin/tools/export_files.php?export_type=externalmodule&what='.urlencode($moduledir).'&compression=zip&zipfilename_template=module_'.$moduledir.'-'.$version.'.notorig" target="_blank" rel="noopener">'.img_picto('', 'download').'</a>';
}