Closed (won't fix)
Project:
Drupal core
Version:
4.7.0
Component:
taxonomy.module
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
25 Feb 2004 at 15:24 UTC
Updated:
16 Apr 2011 at 01:45 UTC
Jump to comment: Most recent file
Comments
Comment #1
TheLibrarian commentedI'll go ahead and implement this in taxonomy.module. The end result will probably look something like the "find orphan pages" functionality in book.module. If you can't wait for the patch, the SQL query that returns the right result is:
SELECT DISTINCT n.nid FROM node AS n LEFT JOIN term_node AS t ON n.nid = t.nid WHERE t.nid IS NULL;
Comment #2
TheLibrarian commentedHere's a patch that will fix this. I'm recategorizing this under the taxonomy component because the changes are to taxonomy.module.
Patch features:
- New 'orphan nodes' item under administer/taxonomy menu.
- Displays table of nodes that have no taxonomy terms associated and that are not book pages.
Caveats emptor
- This function will be expensive for large sites. I imagine the big-O of array_diff_assoc is not great, and if you have a lot of orphans and/or book pages, this will come into play. This page won't be shown very often, however, so this is acceptable.
- array_diff_assoc requires PHP 4.3.0 and up, while array_diff requires PHP 4.0.1. I went with array_diff_assoc because it does an index check that is important to the current implementation. If required, I can backport the patch to support older versions of PHP.
Comment #3
TheLibrarian commentedOops.. this patch is for cvs.
Comment #4
TheLibrarian commentedNew patch version that sets the summary attribute for the table of nodes (gotta be spec-compliant).
Comment #5
TheLibrarian commentedArrghh...
Ok, so here an ever newer version of the patch (sorry about this) that checks that modules exist before trying to query tables that may not exist. It also prunes project issues. Please let me know if I'm missing any node types.
Comment #6
TheLibrarian commentedWell... I'm a moron.
It appears I can't submit a simple correct patch today: every node can have associated taxonomy terms. This is what you get when Drupal-newbies submit patches. Since I can't trust my ability to code right now, I'm gonna wait until tomorrow to post yet another new patch for this. Please don't hurt me.
Comment #7
Gabriel R. commentedLibrarian, you learn from your mistakes ;-)
Thanks for taking care of this, you rock!
Comment #8
moshe weitzman commentedThis patch has too much special case handling which is inelegant. Why are nodes within book pages not considered 'orphans'. Also, the term 'orphan' usually has negative connotation, as if an admin has to do something about it. I don't think thats the case with these nodes.
Perhaps this is best handled in a Contrib module.
Comment #9
TheLibrarian commentedThe special case handling goes away soon; it should never have been there (I have no clue what I was thinking).
As for the PHP version I said this patch requires: that goes away too, because it will no longer need to diff any arrays.
Because of the navigation issues, I think this will be appropriate for inclusion directly in taxonomy.module. The argument I use is my site. I have disabled archive browsing and the tracker for anonymous users. Because not every poster on the site can/will post directly to the front page, taxonomies are the only way for non-trusted users to really browse (sure they could use the search bar, but that's a horrible way to browse). The ability to see which sites are orphaned from the taxonomies is just as important in this case as seeing orphaned book pages. I believe that the original poster has a similar problem on his site, too.
Comment #10
TheLibrarian commentedAnd here is the patch, all pretty and tested, for your consideration.
Comment #11
Gabriel R. commentedI completely agree with TheLibrarian. As stated, I had the "orphan" problem while making a transition from another CMS, but the problem can occur on day-to-day use.
Please consider including this in the release versions.
Thanks.
Comment #12
dries commentedThis functionality belong in the 'administer > content' menu. I suggest extending the existing filters.
Comment #13
ñull commentedIs there another module that is implementing this functionality? Weird that this idea has been dormant so long as if nobody needs this and as if everybody is so perfectly organised (not me).
Comment #14
mile23This is eminently doable with Views and other solutions, plus D4 is unsupported at this late date.