[development] Accessing CCK field data (single, multiple, or shared) from another module

Benjamin Melançon pwgdarchive at gmail.com
Thu Mar 22 12:24:42 UTC 2007


Gracious developers, CCK people especially...

I wrote an access control module that works with the node relativity
module to cascade permissions to all nodes lower in a hierarchy.  I
hard-coded a query for a userreference field on a custom content type
as one way to give a user access to a node (and its descendants).

In generalizing this, the current stumbling block is the way CCK
stores single instances in the content data table and shared instances
of a field in a separate table.

Is there a function for getting the data that you can just give a node
type and a field name and it handles the rest?

Or is there a place to check what the case is for a particular field?
(Even a "column_exists()" function would do it for me, but haven't
found one in PHP...)

It's being developed in Drupal 5 and fixing this (as well as saving
explicitly permitted users when creating a new node) is all that's
needed for posting the project for general use.

Many thanks,

ben

Agaric Design Collective
Open Source Web Development
http://AgaricDesign.com/

People Who Give a Damn
building the infrastructure of a network for everyone
http://pwgd.org/


More information about the development mailing list