fix matching of bib IDs
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 7 Jun 2018 13:41:27 +0000 (09:41 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 7 Jun 2018 13:41:27 +0000 (09:41 -0400)
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index ae55d49..e8ec227 100644 (file)
@@ -98,7 +98,7 @@
             [%- END -%]
 
             <div class="rdetail_aux_utils toggle_list">
-            [% operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
+            [% operation = ctx.mylist.grep('^' _ ctx.bre_id _ '$').size ? "delete" : "add";
                 label = (operation == "add") ? l("Add to Cart") : l("Remove from Cart");
             %]
                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
index 9cd7509..efbffdf 100644 (file)
                                    add_parms.import(
                                         {query => ctx.naive_query_scrub(ctx.user_query)} );
                             END;
-                            is_selected = ctx.mylist.grep(rec.id).size;
+                            is_selected = ctx.mylist.grep('^' _ rec.id _ '$').size;
                         %]
                         <tr class="result_table_row [% IF is_selected %]result_table_row_selected[% END %]">
                                             <td class="results_row_count" name="results_row_count">
@@ -485,13 +485,13 @@ END;
                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
                                                             %]
                                                             <a href="[% addhref %]" id="mylist_add_[% rec.id %]"
-                                                                [% IF ctx.mylist.grep(rec.id).size %] class="hidden" [% END %]
+                                                                [% IF ctx.mylist.grep('^' _ rec.id _ '$').size %] class="hidden" [% END %]
                                                                 title="[% l("Add [_1] to cart", attrs.title) %] rel="nofollow" vocab="">
                                                                 <img src="[% ctx.media_prefix %]/images/add-to-cart.png[% ctx.cache_key %]" alt="" />
                                                                 [% l("Add to cart") %]
                                                             </a>
                                                             <a href="[% delhref %]" id="mylist_delete_[% rec.id %]"
-                                                                [% IF !ctx.mylist.grep(rec.id).size %] class="hidden" [% END %]
+                                                                [% IF !ctx.mylist.grep('^' _ rec.id _ '$').size %] class="hidden" [% END %]
                                                                 title="[% l("Remove [_1] from cart", attrs.title) %] rel="nofollow" vocab="">
                                                                 <img src="[% ctx.media_prefix %]/images/add-to-cart.png[% ctx.cache_key %]" alt="" />
                                                                 [% l("Remove from cart") %]