In rules_link_entity_view() you loop over all rules link and check if it should be rendered on entity view.
First, the link will always be rendered, if possible, regardless of the 'Show link in entity' setting, due to this code

if ($rules_link->entity_type == $type && isset($rules_link->settings['entity_link'])) {

shouldn't be isset($rules_link->settings['entity_link']), as it's always there ;)

Furthermore, using 'return' in a loop skips all other possible rules link in

if (!empty($ids[2]) && !in_array($ids[2], $rules_link->settings['bundles'])) {
  return;
}

which rather should be 'continue'.

CommentFileSizeAuthor
#1 rules_link_entity_view.patch1.26 KBmh86

Comments

mh86’s picture

StatusFileSize
new1.26 KB

And here the patch :)

Furthermore it fixes 'Theme key "links_node_rules_link" not found.' warnings I retrieved from time to time. When using an own theme function, it needs to be registered in hook_theme(). On the other hand it is enough to use the default links implementation as node_build_content() for example does, which can as well be overridden.

sepgil’s picture

thx for patch, I've commited.

sepgil’s picture

Status: Needs review » Closed (fixed)
sepgil’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

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