Bug 31275 - AdditionalContents.search_for_display returns branch block and All block
Summary: AdditionalContents.search_for_display returns branch block and All block
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-01 14:13 UTC by Marcel de Rooy
Modified: 2022-08-18 12:59 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2022-08-01 14:13:14 UTC
If there is a branch specific block, you normally dont want the All block to appear too.
Comment 1 Jonathan Druart 2022-08-01 14:32:21 UTC
That could be a feature... :)

However I've created a OpacNavRight for all and CPL, and only the one from all is displayed. And this is definitely a bug.

Which block did you try?
Comment 2 Katrin Fischer 2022-08-02 07:09:09 UTC
I don't think that assumption is correct in general. Often you have contents that are relevant for all branches and branch specific. The current behavior sounds correct to me. "All libraries" has never acted as a fallback for library specific.

If this is about translations: default and specific language should not both show together.
Comment 3 Katrin Fischer 2022-08-02 07:09:46 UTC
> However I've created a OpacNavRight for all and CPL, and only the one from
> all is displayed. And this is definitely a bug.

Were you logged in? Branch specific only show to logged in users.
Comment 4 Jonathan Druart 2022-08-02 07:43:09 UTC
(In reply to Katrin Fischer from comment #3)
> > However I've created a OpacNavRight for all and CPL, and only the one from
> > all is displayed. And this is definitely a bug.
> 
> Were you logged in? Branch specific only show to logged in users.

Ha, that might be it!
Comment 5 Marcel de Rooy 2022-08-02 11:12:00 UTC
(In reply to Jonathan Druart from comment #1)
> That could be a feature... :)
> 
> However I've created a OpacNavRight for all and CPL, and only the one from
> all is displayed. And this is definitely a bug.
> 
> Which block did you try?

I encountered this behavior while testing bug 29144 which creates a OpacBranchInfo block to replace branches.opac_info.
I somehow assumed the All branches to be a fallback for not having a branch specific one..
When i let the kohanews process directive display the return of AdditionalContents.get in the template, it shows both.
Note that other templates perhaps show one result, but since the sort order is number, it will be a bit random which one appears?
Comment 6 Marcel de Rooy 2022-08-02 11:13:24 UTC
(In reply to Katrin Fischer from comment #2)
> I don't think that assumption is correct in general. Often you have contents
> that are relevant for all branches and branch specific. The current behavior
> sounds correct to me. "All libraries" has never acted as a fallback for
> library specific.

This sounds counterintuitive. If you have a specific block, I would understand it to override the All branches stuff.
Comment 7 Marcel de Rooy 2022-08-02 11:33:01 UTC
(In reply to Katrin Fischer from comment #3)
> > However I've created a OpacNavRight for all and CPL, and only the one from
> > all is displayed. And this is definitely a bug.
> 
> Were you logged in? Branch specific only show to logged in users.

I entered one for All and CPL. I am logged into CPL. And I see both OpacNav blocks. And I really wonder if that should be the case..
Comment 8 Katrin Fischer 2022-08-02 11:58:44 UTC
(In reply to Marcel de Rooy from comment #7)
> (In reply to Katrin Fischer from comment #3)
> > > However I've created a OpacNavRight for all and CPL, and only the one from
> > > all is displayed. And this is definitely a bug.
> > 
> > Were you logged in? Branch specific only show to logged in users.
> 
> I entered one for All and CPL. I am logged into CPL. And I see both OpacNav
> blocks. And I really wonder if that should be the case..

We have inherited this from the news module. I think changing it now could be quite disruptive to libraries as the OPAC behaviour would change.

I think if we want a fallback, maybe we could have an additional checkbox or so? "Use only if no library specific content was generated"
Comment 9 Marcel de Rooy 2022-08-03 11:40:36 UTC
(In reply to Katrin Fischer from comment #8)
> We have inherited this from the news module. I think changing it now could
> be quite disruptive to libraries as the OPAC behaviour would change.

Not sure about that. But no worry, we can add a new method where another behavior is definitely wanted.

Have a look at bug 29144, patch Add $contents->find_best_match, $library->opac_info.
Comment 10 Martin Renvoize 2022-08-18 12:59:56 UTC
I agree with Katrin, the 'All libraries' option is clear to me that is displays for "All libraries'.. i.e. always displays.. we have customers using that in production.. it would be a regression to change the meaning.

However.. I may well be nice to have a fallback option as an alternative too.