No padlock appears for nodereference and userreference fields

MMachnik - March 10, 2009 - 20:58
Project:CCK Field Privacy
Version:5.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

I found that if I chose to enable privacy on a nodereference autocomplete field, the padlock did not appear on the node edit page.

This appears to be because in cck_field_privacy_form_alter(), it needs to look one more level down -- add this:

      if (isset($form_field[0]['node_name']['#title'])) {
        $form_field[0]['node_name']['#title'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
      }

It's already looking in $form_field['#title'] and $form_field[0]['#title'].

I discovered this with autocomplete for nodereference and userreference (for latter it should look for $form_field[0]['user_name']['#title']), but it appears to also be an issue for the non-autocomplete nodereference and userreference fields.

Also, I discovered this in 5.x-1.3 but it looks like it is still an issue in the latest 5.x and 6.x versions.

#1

obsidiandesign - April 28, 2009 - 03:35
Status:active» duplicate

User Reference and Node reference fields are being addressed in the patch/rewrite of cck_field_privacy_form_alter in #427022: hook form_alter rewrite.

Thanks,
Bryan

 
 

Drupal is a registered trademark of Dries Buytaert.