Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
User stories:
As a site builder for a site with content in more than one language, I would like to be able to filter results by the current language in the page request.
Proposed resolution
Add token replacement to the Value field in the Views filter UI.
Remaining tasks
Update issue summaryWrite a patchReview and feedbackRTBC and feedbackCommit
User interface changes
You can now use tokens in the filter value.
API changes
None.
Data model changes
None.
Comments
Comment #2
mparker17Here's a patch. Feedback welcome.
Comment #3
jmdeleon CreditAttribution: jmdeleon commentedTrying this out right now... I like :)
Comment #5
jmdeleon CreditAttribution: jmdeleon commentedHighly useful.
Comment #6
mparker17@jmdeleon, thanks!
***
For reasons I don't fully understand, my site has decided to start using the
SarniaViewsHandlerFilter
class inhandlers/handler_filter_date.inc
instead of theSarniaViewsHandlerFilter
class in thehandlers/handler_filter.inc
. I haven't made any changes to any other files in the Sarnia module; and I'm not even sure how the two classes (which have the same name AFAICT) can be loaded into the same namespace without conflicts, but it seems to be happening, and removingfiles[] = handlers/handler_filter_date.inc
from the .info file apparently causes missing/broken handler errors.Whatever the reason, it seems I also have to patch
handlers/handler_filter_date.inc
if I want token substitution to continue to work on my site. Here's another patch. Interdiff not necessary due to the fact that the previous code was committed.Comment #7
jmdeleon CreditAttribution: jmdeleon commented@mparker17: The situation with the duplicate classes is definitely curious.
handler_filter_date.inc only overrides the function admin_summary() that isn't already in handler_filter.inc, which might be the cause of the broken/missing handler errors when removing handler_filter_date.inc from sarnia.info
So I copied the admin_summary() function to handler_filter.inc and was able to remove handler_filter_date.inc completely without any broken/missing handler errors, while still incorporating your new token support.
Attaching a patch here.
Comment #8
jmdeleon CreditAttribution: jmdeleon commentedUpdated the patch in #7 slightly to apply a bit more cleanly.
Comment #11
jmdeleon CreditAttribution: jmdeleon commentedComment #12
mparker17Updating issue summary.
Comment #13
mparker17