If you set a content block to display only for one library, you do not want it to show prior to that library being defined. Currently, prior to OPAC login, all blocks will display as the library is not yet set.. only the 'all' block should display.
Created attachment 126960 [details] [review] Bug 29332: Set default library limits in search_for_display Koha::AdditionalContents->search_for_display needs to filter to just items with a 'null' branchcode if no library_id is passed. Test plan 1/ Add some additional content blocks that should display only for specific branches. 2/ Navigate to the OPAC and note that blocks display for all libraries prior to login 3/ Login to the OPAC and note that now you only see you users library block 4/ Apply the patch 5/ Repeat steps 2 and 3 and note that now you see only the 'All libraries' blocks display prior to login and that 'All libraries' + 'Your users library' blocks appear after login.
Created attachment 126962 [details] [review] Bug 29332: Unit tests This patch adds unit tests to ensure we do not leak branch specific addtional contents blocks outside of logged in sessions (i.e. where a users branch is not yet set).
Created attachment 126963 [details] [review] Bug 29332: Set default library limits in search_for_display Koha::AdditionalContents->search_for_display needs to filter to just items with a 'null' branchcode if no library_id is passed. Test plan 1/ Add some additional content blocks that should display only for specific branches. 2/ Navigate to the OPAC and note that blocks display for all libraries prior to login 3/ Login to the OPAC and note that now you only see you users library block 4/ Apply the patch 5/ Repeat steps 2 and 3 and note that now you see only the 'All libraries' blocks display prior to login and that 'All libraries' + 'Your users library' blocks appear after login.
Created attachment 126991 [details] [review] Bug 29332: Set default library limits in search_for_display Koha::AdditionalContents->search_for_display needs to filter to just items with a 'null' branchcode if no library_id is passed. Test plan 1/ Add some additional content blocks that should display only for specific branches. 2/ Navigate to the OPAC and note that blocks display for all libraries prior to login 3/ Login to the OPAC and note that now you only see you users library block 4/ Apply the patch 5/ Repeat steps 2 and 3 and note that now you see only the 'All libraries' blocks display prior to login and that 'All libraries' + 'Your users library' blocks appear after login. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 126992 [details] [review] Bug 29332: Unit tests This patch adds unit tests to ensure we do not leak branch specific addtional contents blocks outside of logged in sessions (i.e. where a users branch is not yet set). Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 126993 [details] [review] Bug 29332: Set default library limits in search_for_display Koha::AdditionalContents->search_for_display needs to filter to just items with a 'null' branchcode if no library_id is passed. Test plan 1/ Add some additional content blocks that should display only for specific branches. 2/ Navigate to the OPAC and note that blocks display for all libraries prior to login 3/ Login to the OPAC and note that now you only see you users library block 4/ Apply the patch 5/ Repeat steps 2 and 3 and note that now you see only the 'All libraries' blocks display prior to login and that 'All libraries' + 'Your users library' blocks appear after login. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Straight forward fix with test, PQA
Pushed to master for 21.11, thanks to everybody involved!