Closed (fixed)
Project:
Boost
Version:
6.x-1.x-dev
Component:
Expiration logic
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2009 at 19:11 UTC
Updated:
18 Oct 2009 at 07:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
mikeytown2 commented2 way street as in actual reference and back reference
http://drupal.org/project/nodereferrer
This is actually quite hard to do from the looks. Given nid, get all cck node references (this node points to X (not very useful, X hasn't changed)) & all cck back references (X points to this node (very useful)). Flush all nodes, only going 1 level deep.
Comment #2
markus_petrux commentedNode Relationships can give you back references using dynamically built views.
This module implements methods to obtain node reference fields in a node based on its type, and how to automatically guess the name of the tables where node reference fields are stored, then you just build the query dynamically filtering for the reference column, and that can give you the sum of all nodes that point to a given node.
[EDIT] ie. you can ask CCK for node reference fields, then you can ask CCK which tables these fields use, then you can dynamically build the queries to obtain a list of all nodes that refer to a given node.
Comment #3
markus_petrux commentedAnother module that can give you hints on how to ask CCK about fields and the tables they use:
http://drupal.org/project/cck_referential_integrity
Comment #4
mikeytown2 commented@markus_petrux
I guess there aren't any modules out there I can rely on (get nid's back); meaning I have to code this up, correct?
Comment #5
markus_petrux commentedYes.
I was looking back to the code in CCK Referential Integrity, and I think it is small enough to figure out how this can be done. Look at the file
cck_referential_integrity.incas it contains a couple of functions used to ask CCK for fields, and functions to build this kind of queries dynamically. I hope it can help you deal with your task.For example:
In the same file there are functions that build queries dynamically.
Comment #6
mikeytown2 commentedI need to do this.
Comment #7
mikeytown2 commentedYet another awesome feature, in support of longer cache times.
Comment #8
mikeytown2 commentedfixed admin section
Comment #9
mikeytown2 commentedcommitted