N°1150 AtributeCustomFields : GetForJSON is now delegated to the handler

Method was always returning null before
This commit is contained in:
Pierre Goiffon
2023-04-18 09:23:54 +02:00
parent adcd0eb9b0
commit 3e454de77e
3 changed files with 53 additions and 18 deletions

View File

@@ -980,7 +980,7 @@ abstract class AttributeDefinition
*
* @param mixed $value field value
*
* @return string JSON encoded string of the value
* @return string|array PHP struct that can be properly encoded
*
*/
public function GetForJSON($value)
@@ -13345,13 +13345,20 @@ class AttributeCustomFields extends AttributeDefinition
*
* @param \ormCustomFieldsValue $value
*
* @return array
* @return string|array
*
* @since 3.1.0 N°1150 now returns the value (was always returning null before)
*/
public function GetForJSON($value)
{
return null;
try {
$sRet = $value->GetForJSON();
}
catch (Exception $e) {
$sRet = 'Custom field error: '.$e->getMessage();
}
return $sRet;
}
/**