Skip to content

Comments

N°9223 - Portal - AttributeExternalKey or AttributeEnum are not displayed after adding a link.#802

Open
accognet wants to merge 1 commit intosupport/3.2from
feature/9223-Portal-AttributeExternalKey_adding
Open

N°9223 - Portal - AttributeExternalKey or AttributeEnum are not displayed after adding a link.#802
accognet wants to merge 1 commit intosupport/3.2from
feature/9223-Portal-AttributeExternalKey_adding

Conversation

@accognet
Copy link
Contributor

internal

@accognet accognet self-assigned this Feb 13, 2026
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Feb 13, 2026
@accognet accognet changed the base branch from develop to support/3.2 February 13, 2026 16:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where AttributeExternalKey and AttributeEnum fields were not being displayed after adding a link in the portal. The issue was caused by a mismatch between the data structure returned by GetInformationForLinkedSetAsJsonAction and the structure expected by the JavaScript/Twig templates that consume this data.

Changes:

  • Updated the attribute data structure in GetInformationForLinkedSetAsJsonAction to match the expected format used by portal templates and the PrepareObjectInformation method
  • Renamed att_code to attribute_code and value to value_html for consistency with the rest of the codebase
  • Added metadata fields (object_class, object_id, prefix, attribute_type) required by the JavaScript consumers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1403 to 1404
'css_inline' => $oFieldOutput->GetCss(),
'js_inline' => $oFieldOutput->GetJs(),
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $oFieldOutput is used here but it's only defined inside the if block on line 1391-1395. When $sFieldRendererClass is null, $oFieldOutput will be undefined, causing a fatal error. The css_inline and js_inline properties should only be set when $oFieldOutput is available, similar to how it's done in BsLinkedSetFieldRenderer::PrepareItem (lines 880-887 in sources/Renderer/Bootstrap/FieldRenderer/BsLinkedSetFieldRenderer.php).

Copilot uses AI. Check for mistakes.
Comment on lines 1396 to 1405
$aObjectData['attributes']['lnk__'.$sAttCode] = [
'att_code' => $sAttCode,
'value' => $sValue,
'object_class' => $sLinkClass,
'object_id' => $oNewLink->GetKey(),
'prefix' => 'lnk__',
'attribute_code' => $sAttCode,
'attribute_type' => get_class($oAttDef),
'value_html' => $sValue,
'css_inline' => $oFieldOutput->GetCss(),
'js_inline' => $oFieldOutput->GetJs(),
];
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data structure is missing the 'value_raw' field which is present in both PrepareObjectInformation (line 1462) and BsLinkedSetFieldRenderer::PrepareItem (line 866 in sources/Renderer/Bootstrap/FieldRenderer/BsLinkedSetFieldRenderer.php). For consistency and to maintain the same data structure across similar methods, 'value_raw' should be included here as well, following the same exclusion logic based on ApplicationHelper::GetAttDefClassesToExcludeFromMarkupMetadataRawValue().

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants