Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295276

AJAX rebuild of Views UI form re-renders parts of the form without using Form API, so additional hooks are needed in lieu of hook_form_view_edit_form_alter()

$
0
0

Problem/Motivation

Discovered while investigating this bug in Claro #3067085: Views top dropbutton breaks when editing a view. The cause was narrowed down to the use of a custom template for the Views menu_local_task. On initial load, the local task elements use the suggested template. On AJAX rebuild, they do not.

Proposed resolution

Ideally, this would be something resolved within Claro, but those attempts were not successful.

The approach here changes how the AJAX build takes place. Previously, only parts of the form are rebuilt, using $this->getDisplayTab($view); and $this->renderDisplayTop($view) to retrieve the render arrays that will become the rebuilt content.
The new approach completely rebuilds the form via the the ViewsUIController, which is written to the $build variable. Specific parts of this array become the args for the AJAX requests. Performing the full build from ViewsUIController ensures that all parts of the build process — including template suggestions — are taken into account.

Remaining tasks

  1. Get confirmation this is not a Claro issue
  2. Review
  3. Commit.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 295276

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>