Follow-up to #2287073: Allow views contextual filters to expose the context using argument validation plugins. This is a task because the original issue has introduced the functionality and this issue would intend to expand that.
Problem/Motivation
In #2287073 contextual filters are allowed to expose the context using argument validation plugins. Now we can allow all the entity related arguments to expose the context
Proposed resolution
Pass addtiontial entity meta data using views data to the views argument plugin and expose a valid context. Argument validation plugins can be used as fallback. Exclude NULL views argument from this.
Remaining tasks
Discuss.
Create a patch.
User interface changes
Blocks that have required contextual filters will no longer be shown in the block UI if the necessary context does not exist. Currently those blocks are shown but then don't work.
API changes
The contextual filters will expose the context using argument plugin details.
Comments
Comment #2
dawehnerThis sounds like an interesting issue to explore!
Comment #3
jibran#2287073: Allow views contextual filters to expose the context using argument validation plugins only allows exposing the context only for views block display. Why not move it to display base class and allow all specific display plugins to opt out.
Comment #4
berdirThe original issue is not limited to validators, we already support numeric and string contexts as well. And anyone can implement the method and do something additional too.
I'd actually keep the original issue title and instead rename this to something like "Support entity context for views contextual filters by relying on views data" or so.
Comment #6
kreatil commentedI'd like to pass arguments from block configuration to views blocks contextual filters in order to display or hide views blocks depending on contexts. I'm wondering how I could help out to bring this issue a bit further. What would be the next step here?
Comment #7
kreatil commentedComment #19
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!