privacy padlocks not shown if content type name contains an underscore

svendecabooter - March 26, 2008 - 16:35
Project:CCK Field Privacy
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:obsidiandesign
Status:closed
Description

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

#1

obsidiandesign - April 11, 2008 - 03:46
Assigned to:Anonymous» obsidiandesign
Status:patch (code needs review)» patch (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

obsidiandesign - June 28, 2008 - 06:28
Status:patch (reviewed & tested by the community)» fixed

Committed to 5.x.-1.2.

#3

Anonymous (not verified) - July 12, 2008 - 06:32
Status:fixed» closed

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

#4

BDuell - September 12, 2008 - 01:41

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

 
 

Drupal is a registered trademark of Dries Buytaert.