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
- 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 - Set the argument validation to 'Term IDs separated by , or +'
- Try to preview
- The result stays empty
- 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
Related Issues
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal8.views-module.2095235-5.patch | 1.22 KB | clemens.tolboom |
#1 | drupal8.views-module.2095235-1.patch | 1.1 KB | clemens.tolboom |
Comments
Comment #1
clemens.tolboomAttached patch needs to enable the taxonomy_term view which it does not yet. How should that be done?
Comment #2
dawehnerThe problem is basically #2027115: Allow views to override existing routing items :(
Comment #3
clemens.tolboom@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
gives
Not sure this information is useful though.
Comment #4
clemens.tolboomFixing for stdClass gives
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.
Comment #4.0
clemens.tolboomStunned links
Comment #4.1
clemens.tolboomUpdated issue summary.
Comment #5
clemens.tolboomAttached patch fixes the stdClass error.
Comment #6
clemens.tolboomComment #6.0
clemens.tolboomAdded steps to reproduce.
Comment #7
clemens.tolboomThis relates to #2029509: Add a generic entity argument validation plugin.
Comment #7.0
clemens.tolboomAdded more remaining.
Comment #8
clemens.tolboomThis 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
Comment #8.0
clemens.tolboomAdded XREF https://drupal.org/node/2029509
Comment #9
clemens.tolboom[edit]DRY (do not repeat yourself)[/edit]
Comment #9.0
clemens.tolboomThe view must be cloned to a new path
Comment #18
LendudeCleaning 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.