With "Clean URLs" enabled in Drupal and the "URL Rewrite" plugin enabled in Gallery, links for any album or gallery item have a clean URL in the breadcrumb list. However, the link for "Gallery" itself does not - it instead uses the value of the "Embed URI" field (in this case, "/index.php?q=gallery") from the Gallery module's "Settings" page.

Comments

Wolfey’s picture

I didn't notice this until recently, but in the gallery.module file, line 234 reads:

          // Still does not generate a clean url for /gallery (uses index.php?q=gallery)

Should I mark this issue as a duplicate since it has already been mentioned, or should I leave it open since I wasn't able to find any other issues mentioning it (prior to posting my own)?

profix898’s picture

Status: Active » Closed (won't fix)

We cant do anything about it on the Drupal site as this a limitation of the 'urlGenerator' in Gallery2.

Wolfey’s picture

I'm sorry to hear that - still, thank you for mentioning what is causing this issue.

Two questions I want to ask, though:

  • Is there any way to work around this issue for now, such as by editing module and/or template files?
  • Would a future version of Gallery have a fix for this issue, or is it unlikely to be fixed (in the Gallery 2.x series)?

Just wondering about these things.

DaBricka’s picture

Component: Code » Code / API
Issue summary: View changes

I was able to implement a workaround for this issue by altering the Gallery Module. In gallery_base.inc line 368 find the following line:

return $url_generator->generateUrl($params, $options);

and change it to:

  $return_gallery_url = $url_generator->generateUrl($params, $options);
  if ($return_gallery_url == "http://YOUR_DOMAIN.com/index.php?q=gallery") {
  	return "http://YOUR_DOMAIN.com/gallery";
  } else {
    return $url_generator->generateUrl($params, $options);
  }

Don't forget to replace YOUR_DOMAIN and change "gallery" to your chosen Gallery root. There is probably a better way to do this without altering the module code, but I'm a novice drupal php coder and this module is no longer under development, so no need to worry about overwriting your customization on a module update.