Skip to content

Commit f166850

Browse files
authored
IBX-6612: [Customer] JS exception occurs while user navigate on content action menu (#970)
1 parent e80352c commit f166850

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/bundle/Resources/views/themes/admin/content/edit_base.html.twig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
{% trans_default_domain 'content_edit' %}
66

7+
{% set target_id_prefix = target_id_prefix|default('ibexa-edit-content-sections-content-fields-') %}
78
{% set grouped_fields = grouped_fields|default([]) %}
8-
{% set anchor_params = { items: grouped_fields|keys } %}
9+
{% set anchor_params = { items: grouped_fields|keys|map((label) => {
10+
label,
11+
target_id: target_id_prefix ~ label|lower|slug }
12+
) } %}
913
{% set is_autosave_enabled = ibexa_user_settings['autosave'] is same as('enabled') %}
1014
{% set form_has_autosave = form.autosave is defined %}
1115
{% set default_form_templates = ibexa_admin_ui_config.contentEditFormTemplates %}
@@ -43,7 +47,7 @@
4347
{% if grouped_fields|length > 1 %}
4448
{% for key, group in grouped_fields %}
4549
{% embed '@ibexadesign/ui/anchor_navigation_section.html.twig' with {
46-
anchor_section_key: 'ibexa-edit-content-sections-content-fields-' ~ key|lower,
50+
anchor_section_key: target_id_prefix ~ key,
4751
} %}
4852
{% trans_default_domain 'content_edit' %}
4953
{% import '@ibexadesign/content/edit_macros.html.twig' as edit_macros %}

src/bundle/Resources/views/themes/admin/ui/anchor_navigation_menu.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active">
2222
{% for item in items %}
2323
{% set item_label = item is iterable ? item.label : item %}
24-
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|slug %}
24+
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|lower|slug %}
2525

2626
<li class="ibexa-anchor-navigation-menu__sections-item">
2727
<button

src/bundle/Resources/views/themes/admin/ui/anchor_navigation_section.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div
2-
data-id="#{{ anchor_section_key|slug }}"
2+
data-id="#{{ anchor_section_key|lower|slug }}"
33
class="ibexa-anchor-navigation__section {{ anchor_section_class|default('') }}"
44
>
55
{% block anchor_section_content %}

0 commit comments

Comments
 (0)