Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was looking at the code and found that the function that sets the display label for contact types is in a protected function and the hook_redhen_contact_name_alter doesn't do much to help me in changing the mark-up for display. It gets set here in redhen_contact.entity.inc:
/**
* Specifies the default label, which is picked up by label() by default.
*/
protected function defaultLabel() {
$type = redhen_contact_get_types($this->type);
$wrapper = entity_metadata_wrapper('redhen_contact', $this);
$name = $wrapper->full_name->value();
return $name . ' (' . $type->label . ')';
}
Seems like a simple setting we can include in the RedHen UI, no? I have seen posts about this issue before and I personally have a project where this is applicable.
Comments
Comment #1
levelos CreditAttribution: levelos commentedGood point. c6c50768eaf43160e06eb43b8a823812c211297b removes the bundle from the label and allows for consistent alterability and display.
Comment #2
jhoffmcd CreditAttribution: jhoffmcd commentedThanks levelos!