Hey Drupalistas

I am creating a cd review website with "Artist" as a taxonomy.
Now I struggling with a view.
I am aiming for an alphabetical listing A-B-C-D-E-F... And if you click on "A", you should get a list of all CD reviews of where the taxonomy artist begins with an "A". I don't think this is rocket science, but I can't get it to work.

I am able to create this with the title of my node as a glossary.
But for this I am having troubles.

How to reproduce:
- Content type: Title / Body / Taxonomy
- View: Page + Attachment (CONTEXTUAL FILTERS (term) Taxonomy term: Name --- RELATIONSHIPS Content: Taxonomy terms on node)

This gives me an error:
- Fatal error: Unsupported operand types in /Applications/MAMP/htdocs/www.punkupdates.com/www/sites/all/modules/contrib/views/includes/handler... on line 1032
- Notice: Undefined property: views_many_to_one_helper::$placeholders in views_many_to_one_helper->add_filter() (line 1032 of /Applications/MAMP/htdocs/www.punkupdates.com/www/sites/all/modules/contrib/views/includes/handler...).

Euhm... Help :-).

Comments

Island Usurper’s picture

Version: 7.x-3.5 » 7.x-3.7
Component: Miscellaneous » Code
StatusFileSize
new476 bytes

@yvesvanlaer, upgrade to Views 7.x-3.7. I believe your problem has been fixed there.

However, I'm having a problem with that function, and I'm doing a very similar use case. views_many_to_one_helper::add_filter() has the following code at line 1031:

if ($operator == 'IN') {
  $operator = "$operator IN($placeholder)";
}

If you try to make a glossary contextual filter, but also allow multiple values like "A+B+C" (because you're grouping things together, let's say) then you get a database error because the query does something like

SUBSTRING(taxonomy_term_data.name, 1, 1) IN IN(:db_placeholder)

Removing the extra "$operator" in line 1032 fixed my particular use case.

Island Usurper’s picture

Status: Active » Needs review
mustanggb’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.