This may be related to #651756: Content_profile fields are not showing up but I applied the patch and the rest of my fields appeared.

On a site I'm working on, there are multiple options for names. Our users may have a nom de plume that they use in addition to their real first middle and last names. I'm using the Computed Fields (http://drupal.org/project/computed_field) module to merge these thusly: if the user has entered a value into the pen name field, that is used. Otherwise, combine first, middle, and last to make the "display name."

It would be very handy to be able to assign the display name field to RealName and let it take over everywhere.

Unfortunately, that field does not appear in my fields list and is not an option to be included in the RealName.

I saw the suggestion from the above-linked issue report that the RealName module be uninstalled using the uninstall tab on the modules page, and uninstalled and reinstalled the RealName module after adding my Computed Field.

Comments

smscotten’s picture

Title: Realname doesn't see calculated fields » Realname doesn't see computed fields
smscotten’s picture

I scratched my own itch by adding a line at line 60 of realname_content_profile.inc:

    foreach ($all_fields as $field_name => $field_attributes) {
      switch ($field_attributes['type']) {
        case 'text':
        case 'computed':
          if ($field_attributes['multiple']) {
            drupal_set_message(t('The RealName module does not currently support fields with multiple values, such as @fld.', array('@fld'
 => $field_name)), 'warning');
          }

The addition: case 'computed':

That may be dangerous in practice, because lord knows what kind of content could find its way into a Computed Field, so I don't propose it as a patch, but just as a hack.

capellic’s picture

Thanks for the code!

capellic’s picture

just did a compare with 1.5. The update has not yet been applied so you'll have to re-merge if you upgrade.

smscotten’s picture

I guess the question should be: is it actually dangerous to blindly allow any computed field content to be used for RealName? If not and I was being overcautious when I suggested the added line, then I'd be happy to submit a patch. I'm having trouble imagining all the use cases that people might want and what possibilities could break something. That's why I proposed this as a hack rather than a patch.

hass’s picture

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