Updated: Comment #0

Problem/Motivation

I tried to set required input on a page view. A recoverable exception is thrown regarding the arguments passed to the Area plugin init method. InputRequired::preRender() creates an options array and passes it into AreaPluginBase::init() instead of a DisplayPluginBase object.

This was missed in the original issue #1850792: Make init() method consistent across all views plugins from VDC.

Recoverable fatal error: Argument 2 passed to Drupal\views\Plugin\views\area\AreaPluginBase::init() must be an instance of Drupal\views\Plugin\views\display\DisplayPluginBase, array given, called in core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php on line 86 and defined in Drupal\views\Plugin\views\area\AreaPluginBase->init() (line 41 of core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php).

Proposed resolution

Implement the API correctly.

Remaining tasks

Write a test - possibly figure out why Drupal\views\Tests\Plugin\ExposedFormTest is not adequate?
Write a patch

User interface changes

None

API changes

None

Original report by mradcliffe

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
791 bytes

Found this too, this seems to work, still needs tests.

damiankloip’s picture

Issue tags: +VDC
dawehner’s picture

+1

Berdir’s picture

Tests!

Also, funny test, creating article node type but creating nodes with the default page node type :p Had to fix that to be able to test that I can select something and then it displays rows ;)

tim.plunkett’s picture

Waiting to see the test results, but this looks good to me

Status: Needs review » Needs work

The last submitted patch, 4: views-input-requred-2223251-4-test-only.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Reviewed & tested by the community

Awesome!

mradcliffe’s picture

Nice patch. Test looks good to me too.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit c056dd6 on 8.x by catch:
    Issue #2223251 by Berdir: InputRequired plugin passes incorrect...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.