Merge pull request #20608 from fmarcet/13.0

Fix: Direct download don't work with multicompany
This commit is contained in:
Laurent Destailleur 2022-04-14 22:15:16 +02:00 committed by GitHub
commit e0f8f5d035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -140,6 +141,11 @@ if (!empty($hashp))
$modulepart = $moduleparttocheck;
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
}
$entity = $ecmfile->entity;
if ($entity != $conf->entity) {
$conf->entity = $entity;
$conf->setValues($db);
}
} else {
$langs->load("errors");
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);