N°3677 - Fix AttributeImage.default_image URLs not up to date after app_root_url change (#526)

Many thanks to @sg-gcouronne for this contribution !
This commit is contained in:
Pierre Goiffon
2024-01-22 16:02:41 +01:00
committed by GitHub
parent 31225b9e23
commit 1e3ef6846d
5 changed files with 85 additions and 25 deletions

View File

@@ -8654,6 +8654,20 @@ class AttributeImage extends AttributeBlob
parent::__construct($sCode, $aParams);
}
public function Get($sParamName)
{
$oParamValue = parent::Get($sParamName);
if ($sParamName === 'default_image') {
/** @noinspection NestedPositiveIfStatementsInspection */
if (!empty($oParamValue)) {
return utils::GetAbsoluteUrlModulesRoot() . $oParamValue;
}
}
return $oParamValue;
}
public function GetEditClass()
{
return "Image";