Hi,

I had created a content type in my Drupal install named 'company_profile'. I changed the CCK field privacy settings to allow privacy options for this content type.
However, the padlocks never showed up.

Digging into the code, i found that the content type name is retrieved by the following code:

$node_name_array = explode('_', $form_id);

This broke the functionality for my content type. However, a few lines above the content type name is retrieved in another way:

$form['#node']->type

The attached patch changes the code so it uses the 2nd method to retrieve the name of the content type of the currently watched form, fixing the bug i encountered.

Please review the patch, and commit if it doesn't break anything. I know for me it didn't.

CommentFileSizeAuthor
cck_field_privacy_contenttype.patch1.63 KBsdecabooter

Comments

obsidiandesign’s picture

Assigned: Unassigned » obsidiandesign
Status: Needs review » Reviewed & tested by the community

Patch works as explained - thanks for bringing this inconsistency to my attention. I'll commit to CVS & look at re-rolling a version when I clear #242912: cck field privacy not working.

obsidiandesign’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.-1.2.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

bduell’s picture

The code on the following page does the same thing (but with a single line addition):
http://drupal.org/node/298954