Closed (fixed)
Project:
Views URL Path Arguments
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2017 at 13:02 UTC
Updated:
21 Oct 2019 at 20:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jasloe commenteddeleted
Comment #3
jasloe commentedWondering same and resurrecting this thread. @heddn is the documentation incorrect? Looking at the plugin itself, I see a form building function for the first use case, but nothing for url path validation.
Comment #4
heddnLooks like the D8 port is missing the ViewsArgumentValidator. It has the ViewsArgumentDefault, but not the other set of code. Want to write a quick patch and I'll commit it?
Here's an example to model from: https://cgit.drupalcode.org/drupal/tree/core/modules/views/src/Plugin/vi.... You won't need all the other methods, just this one.
And this is the D7 code: https://cgit.drupalcode.org/views_url_path_arguments/tree/views_plugin_a...
Comment #5
jasloe commentedSure, I'll take a look. Thanks for getting me started!
Comment #6
mlncn commentedI gave this a try: https://gitlab.com/agaric/drupal/views_url_path_arguments/blob/8.x-1.x/s...
The validator is available where it's supposed to be, a separate fieldset titled "When the filter value IS in the URL or a default is provided"
I think it would work. However, due to circumstances beyond my control, the validator was only ever called when the entity it was to match against did not have a path alias to check.
Our view is configured to show a list of blog posts at
blogs/123, where 123 is the user's entity ID (uid).Oh. It's because we migrated all the old path aliases (so
blogs/jimwas set to go toblog/3, and would never touch the View on the new site at all.) Damnit Jim.OK here's a patch and people can also use the fork at https://gitlab.com/agaric/drupal/views_url_path_arguments
But personally i will be pursuing the path alias / pathauto enhancement approach to meeting the same goal, as the structure of our migrated data fits that better. This module is great though!
Comment #7
heddnI'll see if I can set some time aside later to commit https://gitlab.com/agaric/drupal/views_url_path_arguments/blob/8.x-1.x/s...
Comment #9
heddnI've merged https://gitlab.com/agaric/drupal/views_url_path_arguments/blob/8.x-1.x/s... and committed it. It is completely untested, so I'll have to wait for feedback if this is resolved. But marking fixed for now. Someone can open a new issue if it is still a problem.