Move views_ajax_form_wrapper() to ViewsFormBase

Created on 15 July 2014, over 10 years ago
Updated 13 September 2023, about 1 year ago

Problem/Motivation

The views_ajax_form_wrapper() function isn't well documented, and should be part of a class as it's only used in Views forms.

Proposed resolution

Move this to ViewsFormBase, with better documentation.

Remaining tasks

1. Make a patch to fix the documentation:

a) Add a one-line summary, separate from the main function description, to the top.

b) Add a note to the documentation saying it's a function for internal use in the Views UI.

c) Document the parameters:

- For $form_id, copy the docs at https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormBuilderI...

- For $form_state, say

@param array $form_state: An array that stores information about the form. See \Drupal\Core\Form\FormBuilderInterface::buildForm() for details.

d) Document the return value, which is either:
- An AjaxResponse object, for an Ajax response (be sure to include the full namespace).
- The rendered form, as a string.
- A render array with the form title and the rendered form in it.

[This is taken care of in the patch in #19]

2. Novice task -- Test manually to make sure this is working. This function/method is used to allow Views UI to use Ajax update dialogs to update views, rather than having to go to a separate page. So someone needs to apply the patch and make sure the Views UI is still working how it should. Someone familiar with how Views UI works in Drupal 7 or 8 would be good. Test a few areas of the UI screen for a view, like adding a new field, editing an existing filter, removing a sort, etc. Then add a comment to the issue explaining what you tested.

3. Novice task -- Write a draft change notice explaining that internal function views_ajax_form_wrapper() has been removed, and replaced by \Drupal\views_ui\Form/Ajax/ViewsFormBase::ajaxFormWrapper().

User interface changes

None.

API changes

The views_ajax_form_wrapper() and ajax.inc file will be removed, and replaced by a method on ViewsFormBase.

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->
πŸ“Œ Task
Status

Fixed

Version

8.0 ⚰️

Component
Views UIΒ  β†’

Last updated about 1 month ago

Created by

πŸ‡©πŸ‡ͺGermany dawehner

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

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