Hi to all,
I found probably a bug.
In hook_link, on line

if (arg(2) != 'image_gallery' && $node->content['node_images'] && variable_get('node_images_gallery_link_'.$node->type, TRUE)) {

the second condition gave me FALSE.
I inspect $node object and found that array $node->content doesn't contain "node_images" key, but $node contains a "node_images" property.
So i change code in this way.

/**
 * Implementation of hook_link().
 */
function node_images_link($type, $node = null, $teaser = false) {
  global $user;
  $links = array();

  if ($type == 'node' && $node->nid && variable_get('node_images_position_'.$node->type, 'hide') != 'hide') {
    $may_add = array_intersect(array_keys($user->roles), variable_get('node_images_roles_add_'.$node->type, array()));
    if (user_access('create node images') || !empty($may_add)) {
      $links['node_images_edit'] = array(
        'title' => t('Edit node images'),
        'href' => "node/$node->nid/images",
      );
    }

	$node_images_presents = ( $node->content['node_images'] || $node->node_images );

    if (arg(2) != 'image_gallery' && $node_images_presents && variable_get('node_images_gallery_link_'.$node->type, TRUE)) {
      $links['node_images_gallery'] = array(
        'title' => t('Open the image gallery'),
        'href' => "node/$node->nid/image_gallery",
      );
    }
  }

  return $links;
}

If it's not a bug, please forgive me.

Thanks for this wonderful work.

Comments

stefano73’s picture

Status: Needs review » Postponed (maintainer needs more info)

Did you enable the gallery link in the content type admin page?

eliosh’s picture

Yes, enabled.