Bug 30676 - View all ... preferences links don't work when GUI language doesn't match
Summary: View all ... preferences links don't work when GUI language doesn't match
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-04 12:45 UTC by Katrin Fischer
Modified: 2022-06-07 16:30 UTC (History)
1 user (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 Katrin Fischer 2022-05-04 12:45:11 UTC
When you search for a preference, you can see a link "View all x preferences" with x being the heading related preferences are listed under.

The problem is, that while the link uses the English ID, the ID on the heading gets translated, so the links are broken.

Example:
View all self check-in preferences
https://elk-wue.bsz-bw.de:8080/cgi-bin/koha/admin/preferences.pl?tab=circulation#Self_check-in_module

But the heading translated is:
<h3 id="Selbstr_ckgabe"><i class="fa fa-caret-down"></i> Selbstrückgabe</h3>

(There also appears to be an encoding issue)


This is because the heading and the ID get translated by Pootle and it's the same string for description and ID:

https://translate.koha-community.org/de/21.11/translate/de-DE-pref.po#unit=19683992


It's sad, because the feature is so nice :(
Comment 1 Katrin Fischer 2022-05-04 14:16:44 UTC
Actually: This does work. 

Both id attribute and anchor are build with:

[% LINE.title | $HtmlId %]

But this means that the link in a German GUI is different from the English GUI and any other translated one.

So when someone shares a link, it only works, if they have the same active language.
Comment 2 Jonathan Druart 2022-06-07 12:49:21 UTC
That's tricky, I have no idea how to fix that!
Comment 3 Katrin Fischer 2022-06-07 16:30:51 UTC
I am not sure either, apart from having an id in the yaml file for the different headings maybe to use instead of the translated string?

I marked it minor after figuring out it was not totally broken, just depending on the active language. I think it's not a high priority one.