RenderElement::preRenderAjaxForm() does not respect existing Url options.

Created on 7 August 2015, over 9 years ago
Updated 6 February 2023, almost 2 years ago

Problem/Motivation

The current implementation in RenderElement::preRenderAjaxForm() destroys any url options when a Url object is passed for form ajax. This was the root cause of probably 40+ hours of ctools debugging and a huge thanks to dawehner for ultimately sorting it. If a Url object is generated with options in place, we should respect that and not require they be restated in ['#ajax']['options'] manually.

Proposed resolution

Instead of overwriting the Url objects options so whatever is set in ['#ajax']['options'] (which could be empty) simply iterate over the options array and set individual options which will preserve options passed with the Url object.

Remaining tasks

Provide patch
Write tests
Get it done

User interface changes

None

API changes

Should not affect existing core implementations, and might smooth the way for some contrib modules as they begin implementing work here.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

9.5

Component
AjaxΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States eclipsegc

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024