Updated: Comment #8

Problem/Motivation

When enabling, cloning or creating a view with 'X IDs separated by , or +' exceptions are thrown. The first exception hides the second on.

PHP Fatal error:  Class 'Drupal\\node\\Plugin\\views\\argument_validator\\stdClass'
PHP Fatal error:  Call to undefined method Drupal\\taxonomy\\Plugin\\views\\argument_validator\\Term::breakPhrase()

Steps to reproduce

  1. Clone the taxonomy_term view to using a new patch prefix like clone/taxonomy/term/% and clone/taxonomy/term/%/%/feed
    Note enabling a view on an existing path is not working due to #2027115: Allow views to override existing routing items
  2. Set the argument validation to 'Term IDs separated by , or +'
  3. Try to preview
  4. The result stays empty
  5. apache error log contains exception

Proposed resolution

Maybe fixed by #2029509: Add a generic entity argument validation plugin.

Make breakPhrase() available to the argument_validators.

Remaining tasks

  • Write tests for "IDs separated by , or +"
  • Fix the plugin ArgumentValidatorPluginBase used by
    • Drupal\node\Plugin\views\argument_validator\Node.php
    • Drupal\taxonomy\Plugin\views\argument_validator\Term.php
  • Are there more classes? Maybe Drupal\taxonomy\Plugin\views\argument\IndexTidDepth ?

User interface changes

API changes

Original report by @clemens.tolboom

When visiting ie taxonomy/term/1+2 core will fail since #503456: Remove multiple tid and depth handling for core taxonomy paths but views claims on it's argument handler settings it will handle these. This seems not to work.

What puzzles me is the context menu does not appear so maybe the view is not in action on taxonomy/term/1

Testing on admin/structure/views/view/taxonomy_term with either combination (1+2 or 1,2) fails.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clemens.tolboom’s picture

Attached patch needs to enable the taxonomy_term view which it does not yet. How should that be done?

dawehner’s picture

clemens.tolboom’s picture

@dawehner suggested to check the argument validation to allow for the + or , which was not set.

Settings it does not seem to help fixing the views preview either.

Commenting the path for taxonomy.routing.yml

#taxonomy.term_page:
#  path: '/taxonomy/term/{taxonomy_term}'
#  defaults:
#    _content: '\Drupal\taxonomy\Controller\TaxonomyController::termPage'
#  requirements:
#    _entity_access: 'taxonomy_term.view'

gives

PHP Fatal error:  Class 'Drupal\\taxonomy\\Plugin\\views\\argument_validator\\stdClass' not found in /Users/clemens/Sites/drupal/d8/www/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/Term.php on line 120

Not sure this information is useful though.

clemens.tolboom’s picture

Fixing for stdClass gives


PHP Fatal error:  Call to undefined method Drupal\\taxonomy\\Plugin\\views\\argument_validator\\Term::breakPhrase() in /.../core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/Term.php on line 123

The plugin inheritance does not use modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php somewhere.

This probably relate to #1792800: Move code out of handlers.inc.

clemens.tolboom’s picture

Issue summary: View changes

Stunned links

clemens.tolboom’s picture

Issue summary: View changes

Updated issue summary.

clemens.tolboom’s picture

Status: Active » Needs work
FileSize
1.22 KB

Attached patch fixes the stdClass error.

clemens.tolboom’s picture

Title: The argument handler is broken for taxonomy/term/1+2 » The argument handler is broken for argument_validators for path like taxonomy/term/1+2
clemens.tolboom’s picture

Issue summary: View changes

Added steps to reproduce.

clemens.tolboom’s picture

clemens.tolboom’s picture

Issue summary: View changes

Added more remaining.

clemens.tolboom’s picture

Title: The argument handler is broken for argument_validators for path like taxonomy/term/1+2 » The argument handler is broken for argument_validators for path like clone/taxonomy/term/1+2

This is still not fixed. Note the path change in the title. Even cloning to a new path does not work which has nothing to do with #2027115: Allow views to override existing routing items

clemens.tolboom’s picture

Issue summary: View changes
clemens.tolboom’s picture

[edit]DRY (do not repeat yourself)[/edit]

clemens.tolboom’s picture

Issue summary: View changes

The view must be cloned to a new path

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Lendude’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Cleaning up old Views issues.

Followed the steps to reproduce and can't reproduce this anymore. Way too complex an issue to figure out which issue might have fixed this. Feel free to open this back up if you feel this is still an issue.