Entityqueue draggable table widget AJAX breaks destination parameter

Created on 4 January 2023, over 1 year ago
Updated 18 January 2023, over 1 year ago

Problem/Motivation

The change made to resolve #3195163: Error on destination parameter on Edit button β†’ introduces a different bug with the destination parameter in the Edit link when using the draggable table widget. After interacting with the draggable table and invoking AJAX, the (indirect) destination parameter is ultimately set to something with the 'ajax_form=1' and '_wrapper_format=drupal_ajax' query string parameters. So although the right path loads, it simply shows Drupal ajax commands JSON within a textarea!

Steps to reproduce

1. Go to /admin/structure/entityqueue and click 'Edit items'
2. Press 'add item' (whether with a valid item to enter or not). The AJAX that runs will update the Edit links in the table, so their destination parameters gets updated to something like: https://example.com/node/1234/edit?destination=/admin/structure/entityqueue/myqueue_1/myqueue_1%3Fdestination%3D/admin/structure/entityqueue%26ajax_form%3D1%26_wrapper_format%3Ddrupal_ajax
3. Press the edit link for the new item, which takes you to edit the referenced item
4. Save the form, you get redirected to the right path, but with &ajax_form=1&_wrapper_format=drupal_ajax' in the URL, which causes Drupal to output the response as AJAX commands, wrapped in a textarea!! (see \Drupal\Core\Render\MainContent\AjaxRenderer::renderResponse() and \Drupal\Core\EventSubscriber\AjaxResponseSubscriber::onResponse())

Proposed resolution

Change the solution used for #3195163: Error on destination parameter on Edit button β†’ to something that doesn't produce this bug. Perhaps \Drupal::destination()->getAsArray() is needed?

Remaining tasks

Provide patch.

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom james.williams

Live updates comments and jobs are added and updated live.
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.69.0 2024