Title changes not submitted via AJAX Post in some cases

Created on 19 July 2023, over 1 year ago
Updated 21 July 2023, over 1 year ago

Problem/Motivation

When modifying the Title of a node and submitting the form without triggering the ajax search for duplicates,
the changes to the title textfield are not submitted.

Steps to reproduce

  1. Click/Focus on the title textfield and change the text
  2. Without clicking or focusing anywhere else on the page, scroll down and click on the submit ("Save") button

Proposed resolution

This has something to do with what what is described here => https://api.drupal.org/api/drupal/core!core.api.php/group/ajax/10#sec_query

If a form uses an Ajax field, all the query parameters in the current request will be also added to the Ajax POST requests along with an additional 'ajax_form=1' parameter

The title change is not tracked by the URL constructing logic in the RenderElement::preRenderAjaxForm();
as a result the POST-ed request does not include the title field and its respective changes.

As a workaround, in this issue, I propose a 'debounce_keyup' approach that changes the event that triggers the Ajax callback (in which case the 'title' field is properly added and its value POSTed via AJAX).

Remaining tasks

Post a patch

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇨🇭Switzerland stefanos.petrakis@gmail.com Biel, Switzerland

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

Comments & Activities

Production build 0.71.5 2024