Hello,

I want to show only nodes where there is no taxonomy term selected (taxonomy shows "- None selected -")

currently, there is 3 operators in the Taxonomy:term filter:

Is one of
Is all of
Is none of

I can choose "Is none of" and then select all the terms on the right, but then if someone add a new term I have to do edit the view to add the new term manually.

There should be a new operator:

Is none of ALL TERMS

Thank you,

CommentFileSizeAuthor
#17 untagged-views3_export.txt12.91 KBasb
#5 untagged-nodes-view.txt7.63 KBasb

Comments

minhdqa’s picture

ya i have a same issue. I make an exposed filter of taxonomy term as searching but when i create new term, i must edit the view to add the new term manually. What can i do now? help pls

jjkd’s picture

I could use the same thing as well (a views filter that allows selecting nodes that have no taxonomy terms assigned), did anyone ever find any workaround or solution for this?

asb’s picture

Version: 6.x-2.1 » 6.x-2.x-dev

Same issue, subscribing

merlinofchaos’s picture

Status: Active » Fixed

Add the Taxonomy: Term relationship; the relationship has a vocabulary selector I think. You can then filter Term: Tid (set to the relationship) for IS NULL. That will find nodes with no terms in the selected vocabulary.

asb’s picture

Version: 6.x-2.x-dev » 6.x-2.11
Status: Fixed » Active
StatusFileSize
new7.63 KB

Thanks, Merlin, I've been searching for something like this for hours. But - forgive my bleeding ignorance, I can not find a "Taxonomy: Term" relationship, at least not in Views 6.x-2.11.

I'm getting four options:

  1. Taxonomy: Node - Get all nodes tagged with a term.
  2. Taxonomy: Parent term - The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.
  3. Taxonomy: Related terms - The related terms of the term. This can produce duplicate entries if there is more than one related term.
  4. Taxonomy: Related terms - Relate nodes to taxonomy terms, specifiying which vocabulary or vocabularies to use. This relationship will cause duplicated records if there are multiple terms.

The last one ("Relate nodes to taxonomy terms") indeed has a vocabulary selector, and the relationship by default is labeled "term". So this might be the best choice.

If I'm now using this relationship "term" (no matter if set to "required" or not) on the filter "Term: Tid", I'm getting zero records. And yes, there are definitely untagged nodes.

Generated SQL query:

SELECT DISTINCT(node.nid) AS nid, 
node_data_field_gallery_image.field_gallery_image_fid AS node_data_field_gallery_image_field_gallery_image_fid, 
node_data_field_gallery_image.field_gallery_image_list AS node_data_field_gallery_image_field_gallery_image_list, 
node_data_field_gallery_image.field_gallery_image_data AS node_data_field_gallery_image_field_gallery_image_data, 
node.type AS node_type, 
node.vid AS node_vid, 
node.title AS node_title, 
node.created AS node_created, 
RAND() AS _random 
FROM node node 
LEFT JOIN (SELECT td.*, tn.vid AS revision FROM term_data td INNER JOIN term_node tn ON tn.tid = td.tid WHERE td.vid IN (2)) term_data_node ON node.vid = term_data_node.revision 
LEFT JOIN content_type_gallery_image node_data_field_gallery_image ON node.vid = node_data_field_gallery_image.vid 
WHERE (node.type in ('gallery_image')) AND (node.status <> 0) AND (node.sticky = 0) AND (term_data_node.tid IS NULL) 
GROUP BY nid 
ORDER BY _random ASC

(I'm trying to list images without taxonomy terms)

Am I blind or is this simply not working? (Attaching exported view)

Greetings, -asb

Letharion’s picture

Status: Active » Fixed

I can do this fine on a clean Drupal core. (No CCK or other fancy stuff).
Please try the same thing on something simpler to rule out interference from other modules, and re-activate the issue as necessary.

asb’s picture

Status: Fixed » Active

Sorry, I can not reproduce this. If I set the relationship to required, the view outputs no results; if I uncheck the "required", I'm getting bogus results (tagged nodes).

Letharion’s picture

Sorry, you're right. I didn't read properly and was testing something slightly different. I can reproduce your problem.
I think it's caused by the fact that the joins (relationships) doesn't actually ever return NULL, so "IS NULL" never matches.

asb’s picture

@letharion: Thank you for confirming this issue.

However, I just ran into a similar problem where I wasn't using a relation and not even taxonomy (filtering for nodes with non-empty CCK fields with extracted EXIF values). In this case, the IS NULL operator isn't working for me as well. So basically the IS NULL and NOT NULL operators arn't working for me at all with real-world data.

Since I seem to be the only one having these problems I'm probably doing something wrong ;-(

Letharion’s picture

Assigned: Unassigned » Letharion
Category: feature » support

I'm not sure if what this is, so I'm making a support request until I find the time to look more closely at it.

naero’s picture

Was this issue ever resolved? We're looking for an IS NULL and/or IS NOT NULL choice.

iamjon’s picture

Status: Active » Closed (works as designed)

Hi I just checked and it worked,
The settings were
Relationships: Taxonomy: Node - Get all nodes tagged with a term.
Exposed Filters Taxonomy- Term

iamjon’s picture

Assigned: Letharion » iamjon
Status: Closed (works as designed) » Active

Sorry my bad. Rechecking.

gabriel86’s picture

Here is my solution:
1, add a "Relationships", choose "Taxonomy: Terms on node", set "Vocabularies" to what vocabularies you want.
2, add a filter, choose "Taxonomy: Term, Taxonomy term name". choose the relationship of the 1st step, and unlock the operator, now you can have a cup of tea and enjoy the new filter.

kars-t’s picture

Assigned: iamjon » Unassigned
Status: Active » Fixed

Hi

I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.

Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.

asb’s picture

Version: 6.x-2.11 » 6.x-3.0
Category: support » feature
Status: Fixed » Active
StatusFileSize
new12.91 KB

Sorry, but this still does not work in Views 3.

Loading the Views page of the attached view takes 10+ minutes (!) without giving any result, and it causes an excessive CPU load of 12 on a Intel Xeon W3520 with 24 GB of RAM, blocking the database for 15+ minutes completely; MySQL had to be restarted to get the website back, so the way it currently works is malicous and harmful. This was ran on a site with a potential result set of 16,809 image nodes and ~30k taxonomy terms.

Besides that it'd be still nice to be able to locate untagged nodes, imho Views needs some kind of safeguards to prevent even simple Views to kill database servers.

So this issue has three different parts:

  1. Feature request: Allow to filter for untagged nodes;
  2. Bug report: Prevent that Views that operate with taxonomy terms shut down MySQL;
  3. Feature request: Allow Views to operate on sites with non-trivial amounts of nodes and/or taxonomy terms.
mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)