patch to follow

Comments

kreynen’s picture

In this patch I adjusted the hook names to match the module name so they would be called. After I noticed how many time hook_username_alter was called, I commented that out and move the logic to hook_realname_alter and made the Realname module. Realname now handles caching the results after the first lookup so it is much more efficient. You probably wouldn't notice the performance difference on a single user profile, but when calling a View that lists hundreds of usernames looking the contact's display name up on every load is noticeable.

pillarsdotnet’s picture

Thanks; will review as soon as I can.

kreynen’s picture

Any updates on this?

We've deployed the patched version at https://www.channelaustin.org/

I recently created a minimized mirror of CiviCRM so it could be whitelisted and included in packaged install profiles on Drupal.org

#1588192: Please Whitelist this CiviCRM repo minimized to be < 10MB by removing libraries that can be shared from sites/all/libraries

Our goal is to include CiviCRM and several of the CiviCRM related modules that improve the integration in the Moderate level of the Community Media Starter Kit.

I can't include a module that doesn't have an official release. I am willing to help you co-maintain this if that's what it takes to get an official release.

pillarsdotnet’s picture

Will add you as co-maintainer asap.

pillarsdotnet’s picture

Title: Renaming module to civicrm_realname breaks civirm_usertoken hooks » Integrate with realname module.
Status: Active » Fixed

Patch applied to 7.x-1.0 release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.