Skip to content

Commit e1df3f8

Browse files
committed
IBX-8561: Fixed relation list when trying to display unauthorized content
1 parent 03ee5c9 commit e1df3f8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/bundle/Resources/views/themes/admin/ui/field_type/edit/relation_base.html.twig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@
9696
{% set body_rows = [] %}
9797

9898
{% for relation in relations %}
99-
{% set body_row_cols = [] %}
100-
{% set col_raw_actions %}
101-
{{ remove_item_btn }}
99+
{% if relation.contentInfo is not null and relation.contentType is not null %}
100+
{% set body_row_cols = [] %}
101+
{% set col_raw_actions %}
102+
{{ remove_item_btn }}
102103

103-
{% include '@ibexadesign/ui/component/embedded_item_actions/embedded_item_actions.html.twig' with {
104-
content_id: relation.contentId,
105-
location_id: relation.contentInfo.mainLocationId,
106-
version_no: relation.contentInfo.currentVersionNo,
107-
} only %}
108-
{% endset %}
104+
{% include '@ibexadesign/ui/component/embedded_item_actions/embedded_item_actions.html.twig' with {
105+
content_id: relation.contentId,
106+
location_id: relation.contentInfo.mainLocationId,
107+
version_no: relation.contentInfo.currentVersionNo,
108+
} only %}
109+
{% endset %}
109110

110-
{% if relation.contentInfo is not null and relation.contentType is not null %}
111111
{% set col_raw_checkbox %}
112112
<input
113113
type="checkbox"
@@ -199,8 +199,8 @@
199199
class: 'ibexa-relations__item',
200200
attr: {
201201
'data-content-id': relation.contentId,
202-
'data-location-id': relation.contentInfo.mainLocationId,
203-
},
202+
'data-location-id': relation.contentInfo is defined and relation.contentInfo is not null ? relation.contentInfo.mainLocationId,
203+
}|filter(v => v is not null),
204204
}]) %}
205205
{% endif %}
206206
{% endfor %}

0 commit comments

Comments
 (0)