From 8d2d3986f3c7bcccee9eeb54a5ce7a7ea89c3dcd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Nov 2025 21:35:18 +0100 Subject: [PATCH] FIX add constant for the member photo width in web portal + avoid error (#36221) --- htdocs/webportal/class/html.formcardwebportal.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index eae74a79980..38b8480c191 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -454,7 +454,12 @@ class FormCardWebPortal $form = new Form($this->db); $html .= '
'; $html .= '
'; - $html .= $form->showphoto('memberphoto', $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0, 1); + $width = (getDolGlobalString('MEMBER_PHOTO_WIDTH_IN_WEBPORTAL') ? getDolGlobalString('MEMBER_PHOTO_WIDTH_IN_WEBPORTAL') : 128); + if (!getDolGlobalString('MEMBER_PHOTO_ALLOW_EXTERNAL_DOWNLOAD')) { + $width = 0; + $object->photo = ''; // to avoid access error + } + $html .= $form->showphoto('memberphoto', $object, $width, 0, 0, 'photowithmargin photoref', 'small', 1, 0, 1); //include DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; //$html .= getImagePublicURLOfObject($object, 1, '_small'); $html .= '
';