Description
Nicole C. Engard
2014-05-29 16:41:30 UTC
Created attachment 28565 [details] [review] Bug 12330: OpacHiddenItems not affecting Advanced Search This patch affects only the area displayed on Advanced Search by setting the AdvancedSearchTypes OPAC system preference accordingly. Prior to this patch, no filtering based on OpacHiddenItems was done. This patch determines if itemtypes, collections, or shelving locations are hidden and prevents them from being shown. TEST PLAN --------- 1) Back up your DB (always handy) 2) Set the OPAC system preference AdvancedSearchTypes to: 'itemtypes|ccode|loc' (without the single quotes). 3) Set the OPAC system preference OpacHiddenItems to include the lines: itype: [{list of itemtype codes separated by commas}] location: [{list of comma delimited shelving location codes}] ccode: [{list of comma delimited collection codes}] Make sure to exclude one value for each, so there will be at least one known thing on each tab. 4) Open the OPAC. 5) Click on 'Advanced Search' -- three tabs appear: Itemtypes, Collection, Shelving location -- Everything is visible 6) Set the OPAC system preference AdvancedSearchTypes to: 'itemtypes | ccode | loc' (without the single quotes). 7) Refresh the OPAC. -- There will be three tabs, but ugliness ensues. 8) Apply the patch 9) Refresh the OPAC. -- You will see: Itemtypes, Collection, Shelving location -- Only excluded values from OpacHiddenItems will be seen. 10) Run koha qa test tools Created attachment 28566 [details] [review] Bug 12330: OpacHiddenItems not affecting Advanced Search This patch affects only the area displayed on Advanced Search by setting the AdvancedSearchTypes OPAC system preference accordingly. Prior to this patch, no filtering based on OpacHiddenItems was done. This patch determines if itemtypes, collections, or shelving locations are hidden and prevents them from being shown. TEST PLAN --------- 1) Back up your DB (always handy) 2) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes|ccode|loc' (without the single quotes). 3) Set the OPAC system preference OpacHiddenItems to include the lines: itype: [{list of itemtype codes separated by commas}] location: [{list of comma delimited shelving location codes}] ccode: [{list of comma delimited collection codes}] Make sure to exclude one value for each, so there will be at least one known thing on each tab. 4) Open the OPAC. 5) Click on 'Advanced Search' -- three tabs appear: Itemtypes, Collection, Shelving location -- Everything is visible 6) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes | ccode | loc' (without the single quotes). 7) Refresh the OPAC. -- There will be three tabs, but ugliness ensues. 8) Apply the patch 9) Refresh the OPAC. -- You will see: Itemtypes, Collection, Shelving location -- Only excluded values from OpacHiddenItems will be seen. 10) Run koha qa test tools Patch tested with a sandbox, by Nicole Engard <nengard@bywatersolutions.com> That was my first time using the sandbox ... Did I do it right? I don't see the signed off patch attached here. Nicole Hmmm... I don't see the signed off patched either. Created attachment 28570 [details] [review] [SIGNED-OFF] Bug 12330: OpacHiddenItems not affecting Advanced Search This patch affects only the area displayed on Advanced Search by setting the AdvancedSearchTypes OPAC system preference accordingly. Prior to this patch, no filtering based on OpacHiddenItems was done. This patch determines if itemtypes, collections, or shelving locations are hidden and prevents them from being shown. TEST PLAN --------- 1) Back up your DB (always handy) 2) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes|ccode|loc' (without the single quotes). 3) Set the OPAC system preference OpacHiddenItems to include the lines: itype: [{list of itemtype codes separated by commas}] location: [{list of comma delimited shelving location codes}] ccode: [{list of comma delimited collection codes}] Make sure to exclude one value for each, so there will be at least one known thing on each tab. 4) Open the OPAC. 5) Click on 'Advanced Search' -- three tabs appear: Itemtypes, Collection, Shelving location -- Everything is visible 6) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes | ccode | loc' (without the single quotes). 7) Refresh the OPAC. -- There will be three tabs, but ugliness ensues. 8) Apply the patch 9) Refresh the OPAC. -- You will see: Itemtypes, Collection, Shelving location -- Only excluded values from OpacHiddenItems will be seen. 10) Run koha qa test tools Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> All tests pass Did the sign off the traditional way as well to get the attachment - there might be a problem with the sandboxes attaching patches. (In reply to Nicole C. Engard from comment #7) > Did the sign off the traditional way as well to get the attachment - there > might be a problem with the sandboxes attaching patches. I think I did not update git-bz on sandboxes. It is on my todo list... Hi, I tested it on a sandbox and i have a question: location and items types should be hidden on facets too if there are exclued in syspref? Will i create a new bug on bz? Regards, Marjorie (In reply to Marjorie Barry-Vila from comment #9) > [should] location and items types be hidden on facets too if [they] > are exclu[d]ed in [the OpacHiddenItems] syspref? This bug handles just the Advanced Search page's criteria. Facets are on the OPAC results page, and thus beyond the scope of this bug. > Will i create a new bug on bz? I'm not sure, because Bug 10891 was all about customizing which facets are viewable. That would certainly cover the scope of what you are asking about. (In reply to M. Tompsett from comment #10) > (In reply to Marjorie Barry-Vila from comment #9) > > [should] location and items types be hidden on facets too if [they] > > are exclu[d]ed in [the OpacHiddenItems] syspref? > > This bug handles just the Advanced Search page's criteria. Facets are on the > OPAC results page, and thus beyond the scope of this bug. > > > Will i create a new bug on bz? > > I'm not sure, because Bug 10891 was all about customizing which facets are > viewable. That would certainly cover the scope of what you are asking about. Thank you for your reply and corrected faults. You are right for bug 10891. Regards, Marjorie Created attachment 29585 [details] [review] Bug 12330: OpacHiddenItems not affecting Advanced Search This patch affects only the area displayed on Advanced Search by setting the AdvancedSearchTypes OPAC system preference accordingly. Prior to this patch, no filtering based on OpacHiddenItems was done. This patch determines if itemtypes, collections, or shelving locations are hidden and prevents them from being shown. TEST PLAN --------- 1) Back up your DB (always handy) 2) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes|ccode|loc' (without the single quotes). 3) Set the OPAC system preference OpacHiddenItems to include the lines: itype: [{list of itemtype codes separated by commas}] location: [{list of comma delimited shelving location codes}] ccode: [{list of comma delimited collection codes}] Make sure to exclude one value for each, so there will be at least one known thing on each tab. 4) Open the OPAC. 5) Click on 'Advanced Search' -- three tabs appear: Itemtypes, Collection, Shelving location -- Everything is visible 6) Set the Searching system preference AdvancedSearchTypes to: 'itemtypes | ccode | loc' (without the single quotes). 7) Refresh the OPAC. -- There will be three tabs, but ugliness ensues. 8) Apply the patch 9) Refresh the OPAC. -- You will see: Itemtypes, Collection, Shelving location -- Only excluded values from OpacHiddenItems will be seen. 10) Run koha qa test tools Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> All tests pass Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Small rewording in comment only. Created attachment 29586 [details] [review] Bug 12330: [QA Follow-up] Consistency between opac-search and staff client In opac-search two regexes are added for the results of splitting the pref AdvancedSearchTypes, allowing spaces before and after the names. The same regexes should be added to catalogue/search.pl to have the same behavior there. Test plan: Set AdvancedSearchTypes to "itemtypes | ccode | loc " (no quotes). Check OPAC and staff with and without this patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Patches pushed to master. Thanks Mark! |