Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello..i cant seem to filter elements of an address field with views2...im trying to return content by state(province) field and ive added both the province field as a argument and as a filter, but all the results always return!
please help!
thanks
r
Comment | File | Size | Author |
---|---|---|---|
#5 | views_filters-793790-5.patch | 657 bytes | Lendude |
Comments
Comment #1
rbl CreditAttribution: rbl commentedSame here!
Comment #2
secretwep CreditAttribution: secretwep commentedYep, the sub-fields (or whatever the term may be for elements inside the address field) are not exposed. Since I have yet to figure out how to filter or sort on elements of the address, the usefulness of the module has plummeted for me.
Comment #3
alexidze CreditAttribution: alexidze commentedsame here!
when filtering by Country the WHERE clause in the query looks like this
WHERE (node_data_field_dd.field_dd_is_primary = 0) ??
same when using arguments
P.S. "dd" is the name of the address field
Comment #4
ezk1984 CreditAttribution: ezk1984 commentedMe too, the where clause in the SQL query is using the is_primary sub-field instead whatever sub-field we would like to filter on.
Comment #5
LendudeThe issue I ran into was similair. I could add a filter for a specific address field but the filter would always show 'field_xxxxx=0' in the query when I searched for something.
The problem is that als the sub-field views filter handlers are set to 'content_handler_filter_integer'. So you could only search for integers (not very useful). I added a patch that changes all the handlers for the the non-is_primairy fields to 'content_handler_filter_string'. This will make these fields searchable, like you would expect.
Len