The opac/opac-MARCdetail.pl file is what is viewed when "MARC view" is clicked while viewing a specific search result. Items hidden on opac/opac-detail.pl based on OpacHiddenItems are shown! This should not happen. I believe this bug goes back several versions, not just master. While coding this, a lack of use or require in C4::Items was discovered. See bug 10872. By adding calls to GetItemsInfo and GetHiddenItems, a filter on the items is placed. As this is processing MARC data, GetMarcFromKohaField was used to properly determine what the item number (952$9) is. Test Plan ========= 1) Find a biblio with multiple items. (e.g. a book with multiple branches) 2) Look it up in OPAC 3) View the details. 4) In the staff client, set the OpacHiddenItems system preference to hide some of the data. (e.g. homebranch: [BRANCH2HIDE]) 5) Refresh the OPAC 6) Some of the details should be hidden now. Save this URL for later (e.g. http://..../opac-detail.pl?biblionumber=#####) 7) Click the MARC view. 8) All the items are showing. 9) Apply patch from 10872 10) Apply this patch 11) Refresh the OPAC 12) The MARC view should now only show the same things the normal view shows. 13) In the staff client hide all the items for this record using OpacHiddenItems. (e.g. homebranch: [BRANCH1,BRANCH2,BRANCH3]) 14) Refresh the OPAC 15) There should be a "404.pl" displayed. 16) Paste the URL saved in step 6. 17) There should be a "404.pl" displayed. 18) In the staff client blank the OpacHiddenItems system preference. 19) Paste the URL saved in step 6. 20) All the items should be displayed in normal view. 21) Click the MARC view and all the items should be displayed.
Created attachment 20985 [details] [review] Bug 10876 - MARC view displays what should be hidden The opac/opac-MARCdetail.pl file is what is viewed when "MARC view" is clicked while viewing a specific search result. Items hidden on opac/opac-detail.pl based on OpacHiddenItems are shown! This should not happen. I believe this bug goes back several versions, not just master. While coding this, a lack of use or require in C4::Items was discovered. See bug 10872. By adding calls to GetItemsInfo and GetHiddenItems, a filter on the items is placed. As this is processing MARC data, GetMarcFromKohaField was used to properly determine what the item number (952$9) is.
This patch should be rebased on bug 10872.
I tried to fix the conflict but the behavior is not what you described.
I hadn't gotten to fixing this one yet. Basically, this adds a next if check into a loop that builds the %this_row stuff, and would require bug 10872 and 10584 to be applied. I'll be fixing this up shortly.
Created attachment 21079 [details] [review] Bug 10876 - Fix opac-MARCdetail.pl partial hides When OpacHiddenItems is used to hide some, but not all of the items for a biblio, then the opac-MARCdetail page displayed all the items, rather than just the ones intended to be visible. By determining the tag and subtag for items.itemnumber, the loop which builds the big array can be filtered to exclude records that should be hidden.
Created attachment 21082 [details] [review] Fix opac-MARCdetail.pl partial hides Test Plan ========= 1) Find a biblio with multiple items. (e.g. a book with multiple branches) 2) Look it up in OPAC 3) View the details. 4) Normal view and MARC view should have the identical number of items. (Normal view: http://..../opac-detail.pl?biblionumber=#####) (MARC view: http://..../opac-MARCdetail.pl?biblionumber=#####) 5) In the staff client, set the OpacHiddenItems system preference to hide some of the data. (e.g. homebranch: [BRANCH2HIDE]) NOTE: if your multiple items are all the same branch, find another distinguishing feature to hide on. The goal is to hide some but not all items for this biblio. 5) Refresh the OPAC 6) Some of the details should be hidden now in Normal view, but not MARC view. 7) Click the MARC view. 8) All the items are showing. 9) Apply patches from 10872, 10584 10) Apply this patch 11) Refresh the OPAC 12) The MARC view should now only show the same things the normal view shows. (Normal view: http://..../opac-detail.pl?biblionumber=#####) (MARC view: http://..../opac-MARCdetail.pl?biblionumber=#####)
Created attachment 21122 [details] [review] Bug 10876 - Fix opac-MARCdetail.pl partial hides When OpacHiddenItems is used to hide some, but not all of the items for a biblio, then the opac-MARCdetail page displayed all the items, rather than just the ones intended to be visible. By determining the tag and subtag for items.itemnumber, the loop which builds the big array can be filtered to exclude records that should be hidden. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Works as expected, passes koha-qa also.
Created attachment 21135 [details] [review] Bug 10876 - Fix opac-MARCdetail.pl partial hides When OpacHiddenItems is used to hide some, but not all of the items for a biblio, then the opac-MARCdetail page displayed all the items, rather than just the ones intended to be visible. By determining the tag and subtag for items.itemnumber, the loop which builds the big array can be filtered to exclude records that should be hidden. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Works as expected, passes koha-qa also. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The patch depends on bug 10584 and bug 10872. Works as expected. Marked as Passed QA.
Pushed to master. Thanks, Mark!
*** Bug 10194 has been marked as a duplicate of this bug. ***