Download & Extend

privacy padlocks not shown if content type name contains an underscore

Project:CCK Field Privacy
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:obsidiandesign
Status:closed (fixed)

Issue Summary

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.

AttachmentSize
cck_field_privacy_contenttype.patch1.63 KB

Comments

#1

Assigned to:Anonymous» 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.

#2

Status:reviewed & tested by the community» fixed

Committed to 5.x.-1.2.

#3

Status:fixed» closed (fixed)

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

#4

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

nobody click here