kpac : repair Top link
authorBill Erickson <berick@esilibrary.com>
Tue, 26 Jun 2012 19:36:50 +0000 (15:36 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 30 Jul 2012 19:05:05 +0000 (15:05 -0400)
Template Toolkit string.replace() does an inline replacement instead of
returning a value.  Use .replace() correctly when building the Top URL,
or the result will be an empty href, which direct to "here" in
Firefox/Chrome, but directs to "here, minus the page name in the URL"
(e.g. http://domain/eg/kpac/) in IE, which ultimately directs the user
to /eg/opac/login (since it doesn't match any configured paths).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/templates/kpac/parts/paginate.tt2

index c87c9fa..225b74e 100644 (file)
         </td>
 
         <!-- Top of page -->
-        [% IF showtop; href = mmkurl('').replace('#.*', '') %]
-        <td class="to_top_btn"><a href="[% href %]"><img src="[% ctx.media_prefix %]/images/kpac/to_top_btn.png" /></a></td>
+        [% IF showtop %]
+            <td class="to_top_btn"><a href="[% mkurl('').replace('#.*', '') %]">
+                <img src="[% ctx.media_prefix %]/images/kpac/to_top_btn.png" />
+            </a></td>
         [% END %]
     </tr>
 </table>