Background:
As you know, CCK allows you to reuse a field in multiple content types. However, there are some specific setting you can give it for each content type it appears in, such as the description and help text.

The little problem:
If you create a field and share it between two content types (let's call them "parent" and "child" for simplicity), and then use this module to autocreate children from the parent, the unique properties of your custom field are ignored on the parent/node/edit and parent/node/add pages. For some reason the label and help text you defined for this field in the parent will be ignored, and the child-node's field properties will be used instead. This might seem like no big deal, but it may be a clue to solving this bigger issue:

The big problem:
I haven't tested other field types, but if your shared field is a date, then all "from" dates will get recorded correctly, but all "to" dates will be the same as that of the parent node, rendering this module's functionality broken when used in this context.

Comments

colemanw’s picture

Title: Collision when same field exists in parent and child » Multiple problems with shared CCK fields

I just discovered another related issue: fields used in more than one CCK type are only listed & available in one type (among all the collapsed content types) on the node-type/fields/nodewidget page. This means that if a field is shared between 5 content types, this module can only "see" it for one of those types (namely, the last one in the list alphabetically).

ademarco’s picture

This should be solved in HEAD: http://drupal.org/cvs?commit=348812 can you check if the problem still occurs for you?

colemanw’s picture

Wow, thank you for such a fast response. Multiple instances of a CCK field now show up correctly for every content type!

Unfortunately date fields will not validate, entering to and from dates correctly results in an erroneous error message: "The To date must be greater than the From date." and a php error: "warning: Invalid argument supplied for foreach() in /sites/all/modules/date/date/date_elements.inc on line 440"

This issue could be unrelated, but I was not getting such validation errors before applying today's two patches from the CVS.

I need to do some more testing, but this error is occurring even when the parent and child are not sharing a CCK field.

I am using the latest (non-dev) version of date module

colemanw’s picture

Do you have a sense of whether the date issue is related? If not, we should probably open a new issue for it and mark this one fixed. (marking things fixed is just so satisfying, especially within 24 hours of the issue being posted! way to go!)

mikeytown2’s picture

I am also getting issues with the date. It's always getting set to zero.

mikeytown2’s picture

Date is fine if it's required. If it's not required then it gets set to 1969 (zero).

Think it has to do with the internal representation of the date data. if its ISO then no go. if its unix time then we good.

nicothezulu’s picture

I just want to confirm that shared cck fields dont want to work with this module.

installed modules here:
Drupal core 6.24
Content Construction Kit (CCK) 6.x-3.x-dev (2012-Jan-12)
Node Widget 6.x-1.0-beta4

Any move with this issue?

Help would be appreciated. Please Drupal Gurus :D