The navigation in a gallery is broken (was OK in 4.1.0 version). When a gallery has more than one page, the navigation links are respectively

http://localhost/drupal/?q=-1

and

http://localhost/drupal/?q=1

It should be (for a two pages gallery which taxonomy id is 3)

http://localhost/drupal/?q=image/tid/3/page/1 (for )

Comments

bruno’s picture

mmmh, parser doesn't like double '>'...

The navigation in a gallery is broken (was OK in 4.1.0 version). When a gallery has more than one page, the &lt&lt and &gt&gt navigation links are respectively

http://localhost/drupal/?q=-1

and

http://localhost/drupal/?q=1

It should be (for a two pages gallery which taxonomy id is 3)

http://localhost/drupal/?q=image/tid/3/page/1 (for &lt&lt)
http://localhost/drupal/?q=image/tid/3/page/2 (for &gt&gt)

bruno’s picture

Looks like the problem is related to the l() function used in image_thumb_browser(). In 4.1.0 version of the image.module the function lm() was used.


The call:
l(">>", "image/tid/". $data["tid"] ."/page/". $data["page"] + 1)
always returns "1", while the call:
l("<<", "image/tid/". $data["tid"] ."/page/". $data["page"] - 1)
always returns "-1"



Should we fix l() function or patch image.module?

bruno’s picture

Fixed!

Adding a couple of parenthesis solved the problem:

l("&lt;&lt;", "image/tid/". $data["tid"] ."/page/". <b>(</b>$data["page"] - 1<b>)</b>)

and

l("&gt;&gt;", "image/tid/". $data["tid"] ."/page/". <b>(</b>$data["page"] + 1<b>)</b>)

dries’s picture

Great. Are you able to send a patch to the developers mailing list? On *nix, you can create a patch using the following command: cvs diff -u modules/image.module > image.module.patch. If not, I'd be happy to make these (and the other image module) changes manually.

bruno’s picture

I'm not on *nix, but I have cygwin. I'll try to make a patch, but I have to clean up my local copy of image.module first...

bruno’s picture

Patch sent to drupal-devel list.

killes@www.drop.org’s picture

I applied the patch.