I am trying to use Automatic Nodetitles with the CCK Field Perms module, but can't quite get it to work? What I am trying to do is set the node title from a CCK field that is only editable by certain roles. The problem is that CCK Field Perms unsets the form field, essentially making the field value no longer available to auto nodetitle? I tried using both $form_values and tokens to derive the title, but both seem to need the form value. My PHP skills aren't high, but here is the PHP code I was trying to use:

<?php
  $token = '[field_client_group_id-raw]';
  global $form_values;
  if ($form_values[field_client_group_id][0]['value']) {
    if ($form_values[field_client_group_id][0]['value'] == '') {
      return '00000';
    }
    else {
      return $form_values[field_client_group_id][0]['value'];
    }
  }
  else {
    return $token;
  }
?>

Comments

mshaver’s picture

Title: Use with CCK Field Perms Module » Use with Workflow Fields Module

I realize I was referring to the wrong module. It is actually workflow fields that is hiding fields in a workflow, causing auto nodetitle to not work with a hidden field. I opened a request in that module to see if simply disabling the field for non-permissioned users would be a better alternative.

fago’s picture

that's probably a problem with the token integration that doesn't work with this module.

gaurav.kapoor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)