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

Form is built when not using fields

$
0
0

Problem/Motivation

The views builds a form when it should not. If a field usually triggers views to build a form, but the format is switched to not use fields, then the form is created.

Background

DisplayPluginBase.php runs


    // If form fields were found in the view, reformat the view output as a form.
    if ($view->hasFormElements()) {
 

in core/modules/views/src/ViewExecutable.php, line 2450 function hasFormElements runs


  foreach ($this->field as $field) {
    if (property_exists($field, 'views_form_callback') || method_exists($field, 'viewsForm')) {
      return TRUE;
    }
  }

Then a form is created.

How to reproduce

Reference #2855691: Display is wrap in a form and Save button is shown

Install draggableviews module then:

  1. Create a view with a display NOT using fields (e.g. rendered teasers)
  2. Create a second display that uses the table format (to be used as draggable)
    The display format will have to be set for this display only, not all displays.
    For: This page (override)
  3. Add the draggableview content field, but DON'T select to override the defaults.
    For: All displays

Without any external dependencies:
* Add a second page display to the content view
* Give it a path
* For the new display only: set the format to a grid
* For the new display only: set the show to content | teasers
* Visit the new page

Expected result:
The bulk action selector form isn't shown

Actual result:
The bulk action selector form is shown


Viewing all articles
Browse latest Browse all 294413

Trending Articles



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