I have a field in my profile (I'm using a profile from content_profile here, but that's not relevant) that is a text field, but uses a select list widget. I select this field to be part of the realname, but what gets displayed is the key from the select list (since that is what gets stored in the node) rather than the corresponding value in the select list.

(My field is a 'title' field, where 'MRS' maps to 'Mrs', 'CAPT' to 'Captain', etc. I want the realname to read: 'Mrs Jane Smith' or 'Captain John Smith' rather than 'MRS Jane Smith' or 'CAPT John Smith' as it currently does.)

Can the module either be fixed to check for select list widgets and then act appropriately, or could someone please suggest a workaround?

Thanks.

Comments

james.williams’s picture

Having poked around in the code, commenting out the following lines in content_profile_load_profile() in realname_content_profile.inc does make it work:


// (line 21 in realname_content_profile.inc:)
foreach ($contents as $content) {
        /*if (isset($content['value'])) {
          $values[] = $content['value'];
        }
        else {*/
          $values[] = content_format($field_name, $content);
        //}
      }

Is there any good reason for the check for isset($content['value'])? I'm guessing it might be to speed things up, but it does mean things don't get correctly formatted (like in the issue outlined above).

hass’s picture

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