(sitka-tpac) force metarecord display when MR has one constituent result
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 13 Jun 2014 20:36:00 +0000 (13:36 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 2 May 2017 21:12:41 +0000 (14:12 -0700)
When Group Formats & Editions is selected, records are grouped by
metarecord; the MR title is followed by a count of constituent records
(i.e. all records for that MR which are relevant to your search), and
clicking on the title displays all the constituent records.  However,
when there is only one constituent record, clicking the MR title takes
you directly to the master record.  This is problematic if the
constituent record is NOT the master record: for example, if all your
search library's holdings are attached to a sub-record, that sub-record
is the only constituent record, but the holdings will not show in the
display for the master record.

As a workaround, this commit disables the special handling for
metarecords with a single constituent record.  Clicking a metarecord
search result will always take you to the list of constituent records
(even if there is only one such record), never directly to the master
record.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Open-ILS/src/templates/opac/parts/result/table.tt2

index ede6072..fc7891c 100644 (file)
                             # note: rec.id refers to the record identifier, regardless
                             # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id
                             IF rec.mmr_id;
                             # note: rec.id refers to the record identifier, regardless
                             # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id
                             IF rec.mmr_id;
-                                IF rec.mr_constituent_count > 1;
+                                #IF rec.mr_constituent_count > 1;
                                     # metarecords link to record list page
                                     record_url = mkurl(ctx.opac_root _ '/results', 
                                         {metarecord => rec.mmr_id}, ['page']);
                                     # metarecords link to record list page
                                     record_url = mkurl(ctx.opac_root _ '/results', 
                                         {metarecord => rec.mmr_id}, ['page']);
-                                ELSE;
+                                #ELSE;
                                     # for MR, bre_id refers to the master and in
                                     # this case, only, record
                                     # for MR, bre_id refers to the master and in
                                     # this case, only, record
-                                    record_url = mkurl(ctx.opac_root _ '/record/' _ attrs.mr_constituent_ids.0, { badges => rec.badges.join(',') });
-                                END;
+                                    #record_url = mkurl(ctx.opac_root _ '/record/' _ attrs.mr_constituent_ids.0, { badges => rec.badges.join(',') });
+                                #END;
                                 hold_type = 'M';
                             ELSE;
                                 record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id, { badges => rec.badges.join(',') });
                                 hold_type = 'M';
                             ELSE;
                                 record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id, { badges => rec.badges.join(',') });
                                                         [% html_text_attr('title', l('Display record details for "[_1]"', attrs.title)) %]>
                                                         [% attrs.title | html %]
                                                      </a>
                                                         [% html_text_attr('title', l('Display record details for "[_1]"', attrs.title)) %]>
                                                         [% attrs.title | html %]
                                                      </a>
-                                                     [% IF rec.mr_constituent_count.defined && rec.mr_constituent_count > 1 %]
+                                                     [% IF rec.mr_constituent_count.defined %]
                                                      <span title="[% l('This group contains [_1] records', rec.mr_constituent_count) %]">
                                                       ([% rec.mr_constituent_count %])
                                                      </span>
                                                      <span title="[% l('This group contains [_1] records', rec.mr_constituent_count) %]">
                                                       ([% rec.mr_constituent_count %])
                                                      </span>