LP#1746815: Fix sticky hold url param
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Mon, 5 Feb 2018 22:45:22 +0000 (17:45 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 25 May 2018 17:43:25 +0000 (13:43 -0400)
Renamed the hold_id url param from "id" to "hid" and prevent it from
sticking in url's where it not needed.

To test
-------
[1] Log in to the public catalog as a patron that has at least
    two hold requests.
[2] Go to the My Account holds tab and edit one of the holds.
[3] Rather than submit a change, click on the holds tab again.
[4] Note that /only/ the hold you were edit displays, and that the
    'id' URL parameter persists as you navigate through the public
    catalog.
[5] Apply the patch and repeat steps 1-3. This time, you should
    see all of the holds.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/holds.tt2
Open-ILS/src/templates/opac/parts/myopac/base.tt2
Open-ILS/src/templates/opac/parts/topnav.tt2

index b630517..027948b 100644 (file)
@@ -951,7 +951,7 @@ sub load_myopac_holds {
     my $limit = $self->cgi->param('limit') || 15;
     my $offset = $self->cgi->param('offset') || 0;
     my $action = $self->cgi->param('action') || '';
-    my $hold_id = $self->cgi->param('id');
+    my $hold_id = $self->cgi->param('hid');
     my $available = int($self->cgi->param('available') || 0);
 
     my $hold_handle_result;
index 5a0c3c4..d881d9f 100644 (file)
                     [%- END; END; %]
                     </td>
                     <td class="opac-auto-161">
-                        <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]"
+                        <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {hid => ahr.id}) %]"
                             [% html_text_attr('title', l('Edit hold for item [_1]', attrs.title)) %]>
                             [% l('Edit') %]
                         </a>
index 94259db..15cf56e 100644 (file)
@@ -37,7 +37,7 @@
                     ELSE;
                         cls_which = "acct-tab-off";
                     END -%]
-                <a href="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url, {}, ['bbid', 'offset', 'limit','sort','sort_type']) %]"
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url, {}, ['bbid', 'offset', 'limit','sort','sort_type', 'hid']) %]"
                     class="[% cls_which %]">[% page.name; %]</a>
                 [% END %]
             </div>
@@ -52,7 +52,7 @@
                     <option value="" selected="selected">[% l('Go to...') %]</option>
                     [% FOREACH page IN myopac_pages;
                       IF page.url != myopac_page; %]
-                        <option value="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url, {}, ['bbid', 'offset', 'limit']) %]">[% page.name; %]</option>
+                        <option value="[% mkurl(ctx.opac_root _ '/myopac/' _ page.url, {}, ['bbid', 'offset', 'limit', 'hid']) %]">[% page.name; %]</option>
                     [% ELSE; %]
                         <option value="" disabled>[% page.name; %]</option>
                     [% END;
index e84fbca..68fd3bb 100644 (file)
@@ -24,7 +24,7 @@
                 <span class="dash_divider">|</span>
                 <span class="dash_account_buttons">
                 <div id="dash_user_message_button_container">
-                    <a href="[% mkurl(ctx.opac_root _ '/myopac/messages', {}, ['single', 'message_id']) %]" class="opac-button">
+                    <a href="[% mkurl(ctx.opac_root _ '/myopac/messages', {}, ['single', 'message_id', 'hid']) %]" class="opac-button">
                         [% l('Messages') %]
                     </a>
                     [% IF ctx.user_stats.messages.unread %]
@@ -34,9 +34,9 @@
                         </div>
                     [% END %]
                 </div>
-                <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, ['single', 'message_id', 'sort','sort_type']) %]"
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, ['single', 'message_id', 'sort','sort_type', 'hid']) %]"
                     class="opac-button">[% l('My Account') %]</a>
-                <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {}, ['single', 'message_id']) %]"
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {}, ['single', 'message_id', 'hid']) %]"
                     class="opac-button">[% l('My Lists') %]</a>
                 <a href="[% mkurl(ctx.opac_root _ '/logout', {}, 1) %]"
                     class="opac-button" id="logout_link">[% l('Logout') %]</a>
             <div id="dashboard">
                 <span class="dash-align">
                     <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/circs', {}, 
-                        ['limit','offset', 'single', 'message_id', 'sort','sort_type'])
+                        ['limit','offset', 'single', 'message_id', 'sort','sort_type', 'hid'])
                         %]"><span id="dash_checked">[% ctx.user_stats.checkouts.total_out
                         %]</span> [% l("Checked Out") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
                     <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds', {}, 
-                        ['available', 'single', 'message_id', 'sort','sort_type'])
+                        ['available', 'single', 'message_id', 'sort','sort_type', 'hid'])
                         %]"><span id="dash_holds">[% ctx.user_stats.holds.total
                         %]</span> [% l("On Hold") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
                     <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/holds',
-                        {available => 1}, ['single', 'message_id', 'sort','sort_type']) %]"><span id="dash_pickup">[%
+                        {available => 1}, ['single', 'message_id', 'sort','sort_type', 'hid']) %]"><span id="dash_pickup">[%
                         ctx.user_stats.holds.ready %]</span> [% l("Ready for Pickup") %]</a>
                 </span>
                 <span class="dash_divider">|</span>
                 <span class="dash-align">
-                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, ['single', 'message_id', 'sort','sort_type'])
+                    <a class="dash-link" href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, ['single', 'message_id', 'sort','sort_type', 'hid'])
                         %]"><span id="dash_fines">[% money(ctx.user_stats.fines.balance_owed)
                         %]</span> [% l("Charges") %]</a>
                 </span>