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

Move views_ajax_form_wrapper() to ViewsFormBase

$
0
0

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.


Viewing all articles
Browse latest Browse all 295117

Trending Articles



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