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'.
Comments
Comment #1
mh86 commentedAnd 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.
Comment #2
sepgil commentedthx for patch, I've commited.
Comment #3
sepgil commentedComment #4
sepgil commented