where nodereference stores its data?
| Project: | Content Construction Kit (CCK) |
| Version: | 5.x-1.6-1 |
| Component: | nodereference.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | DesignWork |
| Status: | closed |
Jump to:
Dear Maintainers,
I just need a quick explanation for the way nodereference stores its data.
I am working with user as nodes. In some content types an author can select existing users for this content type as node references, like an Director of an Film he is uploading. He can also create a new "stakeholder" if the searched person/user is not in the database.
Now comes my Problem
Later it could happend, that the new created "stakeholder" becomes a real user in the system. So that I need to merge the two nodes. What I´am doing at the moment is that a admin can select the "stakeholder" and the true Person via a dropdowns.
Wenn he submits his choise I (the module) go to the database and search the "stakholder nid" (node id) in all possible content types for example the table content_type_spot. In this table i find a lot of nodereference field all ending with _nid. So i check all nid in this fields and if i find the "stakeholder nid" it will be overridden with the real user nid (node id).
This works. But when I go to the node where the reference should be displayed, in this case a spot where the stakeholder was the director no value will be displayed even if in the table content_type_spot in the field_ggg_nid is the right "node id"
So this lookslike nodereference stores is data elsewhere. But where?
Warm regards from Cologne
Dirk

#1
Nodereference stores its data in a 'field_FIELDNAME_nid' column, that can be :
- in a table named content_field_FIELDNAME if this noderef field accepts multiple values or appears in several content-types
- or in a table named content_type_FIELDNAME otherwise (if field is single value, and appears only in this content type)
This pattern is common to all CCK fields.
This means the location of the data can move, depending on the settings the admin can change.
The following bit of code will let you determine the storage information for a field at a given time :
$field = content_fields('FIELD_NAME', 'CONTENT_TYPE_NAME');db_info = content_database_info($field);
#2
Dear Yched,
thanks for the reply. Helped me :)
Dirk
#3
Automatically closed -- issue fixed for two weeks with no activity.