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 |
Jump to:
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']->typeThe 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.
| Attachment | Size |
|---|---|
| cck_field_privacy_contenttype.patch | 1.63 KB |

#1
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
Committed to 5.x.-1.2.
#3
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