Wrong view mode query on paragraph edit links leads to always full page reload although Ajax content update enabled

Created on 23 July 2025, 10 days ago

Problem/Motivation

Ajax content update enabled. Still, always a full page reload is triggered on paragraphs edit. While moving up and down and inserting new paragraphs works totally fine with Ajax.

Turns out this happens when the view mode of the parent entity and the view mode of the paragraph don't match. For example node comes in full view mode and paragraph comes in default view mode.

Article comes with hidden trigger link (note the selector data-fe-update-content="node--1--field_content_paragraphs--full"):

<a href="/frontend-editing/update-content/node/1/field_content_paragraphs/full" title="Reload content for this field" class="use-ajax frontend-editing-update-content visually-hidden" data-fe-update-content="node--1--field_content_paragraphs--full" data-once="ajax">Reload content for this field</a>

And paragraph comes with view_mode_id URL query param in the edit link, used to build the selector later that is needed to click the hidden link (note view_mode_id=default

<a href="/frontend-editing/form/paragraph/19222?view_mode_id=default" title="Edit" class="frontend-editing-open-sidebar frontend-editing__action frontend-editing__action--edit">Edit</a>

This view_mode_id URL query param is later used to build the DOM selector to perform a hidden click on data-fe-update-content="node--1--field_content_paragraphs--full" for the Ajax update.

But since view_mode_id on the paragraph edit link is default, it tries to click on data-fe-update-content="node--1--field_content_paragraphs--default" instead, which does not exist.

Instead of doing a nice Ajax content update, it now reloads the whole window:

          const element = document.querySelector(selector);
          if (element) {
            element.click();
          } else {
            window.location.reload();
          }

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

leymannx Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024