What's the point of hook_commons_utility_links() when commons_notify_commons_utility_links_alter() completely removes all other alterations? I'm trying to add my own utility links but unless I change my module's weight, nothing happens.

  $new_links = array(
    'name' => $links['name'],
  );

  // ...

  $new_links['logout'] = $links['logout'];
  $new_links['settings'] = $links['settings'];

  $links = $new_links;

Comments

ezra-g’s picture

Title: Commons Notify overwrites utility links » commons_notify_commons_utility_links_alter() overwrites the $links array, removing custom links

I believe that mentions of a hook_commons_utility_links() are actually in error, and that these implementations are actually of hook_commons_utility_links_alter().

I'm trying to add my own utility links but unless I change my module's weight, nothing happens.

However, I can see how commons_notify_commons_utility_links_alter(), which overwrites $links with a $new_links array could overwrite custom links in some cases. I don't immediately see a reason why this is necessary, so retitling with the specific problem here.

Thanks for the report! If you'd like to help fix this bug, you can start by filing a patch.

Devin Carlson’s picture

Issue summary: View changes
Status: Active » Fixed

This was fixed as part of #2032427: Message icon appears in header even when trusted contacts/private messages disabled since the approach which caused this issue was no longer necessary.

Status: Fixed » Closed (fixed)

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