diff --git a/datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php b/datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php
index 88f5f6dcd..9dd64cfbb 100644
--- a/datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php
+++ b/datamodels/2.x/itop-portal-base/portal/src/Controller/ObjectController.php
@@ -1408,14 +1408,14 @@ class ObjectController extends BrickController
protected function PrepareObjectInformation(DBObject $oObject, $aAttCodes = array())
{
$sObjectClass = get_class($oObject);
- $aObjectData = array(
+ $aObjectData = [
'id' => $oObject->GetKey(),
'name' => $oObject->GetName(),
- 'attributes' => array(),
- );
+ 'attributes' => [],
+ ];
// Retrieving attributes definitions
- $aAttDefs = array();
+ $aAttDefs = [];
foreach ($aAttCodes as $sAttCode)
{
if ($sAttCode === 'id')
@@ -1429,13 +1429,30 @@ class ObjectController extends BrickController
// Preparing attribute data
foreach ($aAttDefs as $oAttDef)
{
- $aAttData = array(
- 'att_code' => $oAttDef->GetCode(),
- );
+ $aAttData = [
+ 'object_class' => $sObjectClass,
+ 'object_id' => $oObject->GetKey(),
+ 'attribute_code' => $oAttDef->GetCode(),
+ 'attribute_type' => get_class($oAttDef),
+ ];
+
+ // - Value raw
+ // For simple fields, we get the raw (stored) value as well
+ $bExcludeRawValue = false;
+ foreach (ApplicationHelper::GetAttDefClassesToExcludeFromMarkupMetadataRawValue() as $sAttDefClassToExclude)
+ {
+ if (is_a($oAttDef, $sAttDefClassToExclude, true))
+ {
+ $bExcludeRawValue = true;
+ break;
+ }
+ }
+ $aAttData['value_raw'] = ($bExcludeRawValue === false) ? $oObject->Get($oAttDef->GetCode()) : null;
+
if ($oAttDef->IsExternalKey())
{
- $aAttData['value'] = $oObject->GetAsHTML($oAttDef->GetCode().'_friendlyname');
+ $aAttData['value_html'] = $oObject->GetAsHTML($oAttDef->GetCode().'_friendlyname');
// Checking if user can access object's external key
if ($this->oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $oAttDef->GetTargetClass()))
@@ -1467,14 +1484,14 @@ class ObjectController extends BrickController
{
$sUrl = $oAttDef->Get('default_image');
}
- $aAttData['value'] = '';
+ $aAttData['value_html'] = '
';
}
elseif ($oAttDef instanceof AttributeEnum) {
- $aAttData['value'] = $oAttDef->GetAsPlainText($oObject->Get($oAttDef->GetCode()));
+ $aAttData['value_html'] = $oAttDef->GetAsPlainText($oObject->Get($oAttDef->GetCode()));
}
else
{
- $aAttData['value'] = $oAttDef->GetAsHTML($oObject->Get($oAttDef->GetCode()));
+ $aAttData['value_html'] = $oAttDef->GetAsHTML($oObject->Get($oAttDef->GetCode()));
if ($oAttDef instanceof AttributeFriendlyName)
{
diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
index b0dda5793..f42884158 100644
--- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
@@ -9,7 +9,7 @@