I have a page view set up with multiple contextual filters. The last filter is a "Global: Null" I have set up to block unneeded arguments. This should catch all nonexistent pages and display "Page Not Found" and works in all cases except when the final argument is 'all':
- /arg1/arg2/invalid-page shows Page Not Found
- /arg1/arg2/all shows all results for /arg1/arg2
This seems to be the behavior specified when the "Exceptions" field contains "all". I can solve this in other filters by clearing the "Exceptions" field of all text, but the Global: Null filter does not contain an Exceptions section. See attached screenshot.
Full contextual filter options for Global: Null:
When the filter value is not in the URL:
Display all results for the specified field
When the filter value is in the URL or a default value is provided:
Specify validation criteria:
Validator: - Basic validation
Action: Show "Page not found"
More:
Fail basic validation if any argument is given
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | views-no_way_to_remove_all_exception_from_glob-1951456-12.patch | 624 bytes | andrew answer |
| #5 | views-no_way_to_remove_all-1951456-5.patch | 617 bytes | nikolay shapovalov |
| #4 | global_null_configuration.jpg | 109.32 KB | nikolay shapovalov |
| #4 | views-no_way_to_remove_all-1951456-4.patch | 758 bytes | nikolay shapovalov |
| no-exceptions.png | 42.75 KB | indyana |
Comments
Comment #1
markosef commentedNot the same problem but I did "show page not found" for the "When the filter value is not in the URL:" and this removes it at least from breadcrumbs, but it is still in the system.
Comment #1.0
markosef commentedFixed path examples
Comment #2
nikolay shapovalov commentedOkay, I have the same issue. Is there any solution?
Comment #3
nikolay shapovalov commentedOkay, i just comment line 34 in file
handlers/views_handler_argument_null.incThan i see the form with exceptions, there was "all".
I remove it, than saved, and all works fine.
I think it's due to default value.
Comment #4
nikolay shapovalov commentedThis is working patch.

1.Apply patch.
2. then remove current Global:null argument.
3. create new one Global:null
4. Configure it like on screenshot
and it should works.
Comment #5
nikolay shapovalov commentedThis is the same patch but with less code.
Test this patch using instructions from comment #4
Comment #6
nikolay shapovalov commentedComment #7
nikolay shapovalov commentedComment #8
nikolay shapovalov commentedComment #9
nikolay shapovalov commentedWhy does nobody test my patch?
This is issue is still working in 7.x-.3.8.
Comment #10
mustanggb commentedComment #11
chris matthews commentedThe 5 year old patch in #5 to views_handler_argument_null.inc does not apply to the latest views 7.x-3.x-dev.
Comment #12
andrew answer commentedPatch rerolled.