Added "$object" parameter to $formfile->showdocuments call

Added "$object" parameter to $formfile->showdocuments call in order to use the $object reference on the showDocuments hook called inside showdocuments function.
Otherwise, the hook is called with a null reference.
This commit is contained in:
spooky360 2022-07-22 09:51:57 +02:00 committed by GitHub
parent a0698bbdf5
commit 5d75ea015b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2665,7 +2665,7 @@ if ($action == 'create') {
$delallowed = $usercancreate;
$modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->COMMANDE_SUPPLIER_ADDON_PDF));
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang);
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang, '', $object);
$somethingshown = $formfile->numoffiles;
// Show links to link elements