[Bug 18634] New: Missing empty line at end of opac.pref
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Bug ID: 18634 Summary: Missing empty line at end of opac.pref Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: philippe.blouin@inlibro.com QA Contact: testopia@bugs.koha-community.org The subject line says it all. When this line is missing, all Payment(PayPal) sysprefs don't show up in translated pages. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #1 from Blou <philippe.blouin@inlibro.com> --- Created attachment 63550 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63550&action=edit Bug 18634 - Missing empty line at end of opac.pref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored CC| |philippe.blouin@inlibro.com Patch complexity|--- |String patch Status|NEW |Needs Signoff Assignee|oleonard@myacpl.org |philippe.blouin@inlibro.com --- Comment #2 from Blou <philippe.blouin@inlibro.com> --- It's a shame to have a commit line just for that, but really, that's the reason this is not translatable. Or rather, it translates but don't show up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #3 from Blou <philippe.blouin@inlibro.com> --- Sponsored by : CCSR -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #4 from Marc Véron <veron@veron.ch> --- I could not reproduce on current master with de-DE and it-IT However an empty line 826 seems to be superfluous. Other *.pref-files do not have an empty line at the end. So I think it is better to just remove line 826. What do you think about? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #5 from Blou <philippe.blouin@inlibro.com> --- For me, I enter "paypal" in the system preferences search and get 6 entries under Payment in English. I get nothing in French. Adding the empty line fixes it. Now, is it useless and senseless? I agree. I looked at circulation.pref for comfort before commiting, and saw the "semi-emtpy" line. I looked at fr-CA-pref.po for weirdness, could not find any. The # OPAC > Payments where right in the middle, all happy and comfy. If ONE wouldn't show up, I'd get it. But all six? It really points to opac.prefs, but I have no idea why (beside this dummy end line). :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #6 from Marc Véron <veron@veron.ch> --- Hi Blou I just did a git pull and then wanted to apply and sign off your patch. But now it seems that already without your patch the last line 826 has vanished. Maybe it was fixed by another patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to Marc Véron from comment #6)
Hi Blou I just did a git pull and then wanted to apply and sign off your patch. But now it seems that already without your patch the last line 826 has vanished. Maybe it was fixed by another patch?
The same for me, but opac.pref was touch last time about 3 month ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marc Véron from comment #6)
Hi Blou I just did a git pull and then wanted to apply and sign off your patch. But now it seems that already without your patch the last line 826 has vanished. Maybe it was fixed by another patch?
No this is about git and whitespace settings.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Blou from comment #5)
For me, I enter "paypal" in the system preferences search and get 6 entries under Payment in English. I get nothing in French. Adding the empty line fixes it.
Now, is it useless and senseless? I agree. I looked at circulation.pref for comfort before commiting, and saw the "semi-emtpy" line.
I looked at fr-CA-pref.po for weirdness, could not find any. The # OPAC > Payments where right in the middle, all happy and comfy.
If ONE wouldn't show up, I'd get it. But all six? It really points to opac.prefs, but I have no idea why (beside this dummy end line).
:(
Several other .pref files do not have this empty line at the end. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Just looked a bit deeper in the code: misc/translator uses YAML::Syck::LoadFile on a pref file admin/preferences first uses gettemplate on a pref file, runs template->output and feeds that into YAML::Syck::Load Seems your problem is related to the second route. In order to know what happens with your french prefs, please examine the output of $data=gettemplate(...) and then $data->output in a test script, making sure that gettemplate reads your french file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Could you add your french pref file as an attachment here too? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63655&action=edit Sample test code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #13 from Blou <philippe.blouin@inlibro.com> --- Created attachment 63656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63656&action=edit File causing the problem -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #14 from Blou <philippe.blouin@inlibro.com> --- Thanks Marcel, I joined the file I have on my laptop. I had moved from the problem to other issues, but I'll be happy to do your test as soon as I find 10 minutes, sooner rather than later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Blou from comment #14)
Thanks Marcel, I joined the file I have on my laptop. I had moved from the problem to other issues, but I'll be happy to do your test as soon as I find 10 minutes, sooner rather than later.
Hi. Could you also attach the actual opac.pref ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #16 from Blou <philippe.blouin@inlibro.com> --- Created attachment 63660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63660&action=edit Translated fr-CA opac.pref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Blou from comment #16)
Created attachment 63660 [details] [review] Translated fr-CA opac.pref
Blou, When I am copying your opac.pref over my english opac.pref, and I am searching for paypal, I do find all paypal preferences, regardless of adding or removing an empty line to this file? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #18 from Blou <philippe.blouin@inlibro.com> --- :( of course, I sent you the one "fixed" with the extra line before translation, so I guess the resulting one doesn't cause trouble. gimme a sec -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Blou from comment #18)
:( of course, I sent you the one "fixed" with the extra line before translation, so I guess the resulting one doesn't cause trouble.
I always want the files with the problems :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63660|0 |1 is obsolete| | --- Comment #20 from Blou <philippe.blouin@inlibro.com> --- Created attachment 63690 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63690&action=edit Translated fr-CA opac.pref Version that hide 'paypal' results. (I just tested again before submitting) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Can we have a test plan and screenshot please? That will ease the understanding. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #22 from Blou <philippe.blouin@inlibro.com> --- Created attachment 64267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64267&action=edit French search for 'paypal' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #23 from Blou <philippe.blouin@inlibro.com> --- Created attachment 64268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64268&action=edit English search for 'paypal' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.begin@inLibro.com, | |francois.charbonnier@inlibr | |o.com, | |marjorie.barry-vila@ccsr.qc | |.ca --- Comment #24 from Blou <philippe.blouin@inlibro.com> --- This problem has been known by Eric Bégin for many years. I guess usually we do not care, or it doesn't trigger. I've never done the deep dive like Marcel did to find the cause. All I know is that it happens in many cases for them (the users). On the CCSR's branch I just added a empty line at the bottom of EVERY .pref files, and it resolved all their missing parameters problems. As far as test case 1) translate install fr-CA 2) search for 'paypal' in the sysprefs screen. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #25 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Have debugged LangInstaller a *bit*: And found that this part in the PO file seems to be the source of the problems: # OPAC > Payments msgid "opac.pref Payments" msgstr "Vie privée" # OPAC > Policy msgid "opac.pref Policy" msgstr "Politique" # OPAC > Privacy msgid "opac.pref Privacy" msgstr "Vie privée" When you install fr-CA both tabs Payments and Privacy are translated to Vie privee. In the code in LangInstaller, in the for loop around line 335 (for my $section) this causes an overwrite of the Payments hash by the Privacy hash. Please create a unique translated key for each tab, and your problem should be gone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- But this does not mean by definition that we should be satisfied with this overwriting hash key problem in the code. Will give it a little try still. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 64283 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64283&action=edit Bug 18634: Handle colliding translation for preference sections Problem on this report was caused by translating the tabs Privacy and Payments by the same string. This caused overwriting a hash entry. This patch tests if the key already exists and if so, it merges the entries instead of overwriting the old contents. Test plan: [1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee. [2] Run translate install fr-CA (or the language you altered) [3] Without this patch you should loose preferences from either Privacy or Payments. With this patch, they should be merged. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fr-CA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Blou, Could you test the latest patch attached? If you agree, I will remove the first one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63655|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63656|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63690|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Missing empty line at end |Missing empty line at end |of opac.pref |of opac.pref / colliding | |translated preference | |sections -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|String patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64283|0 |1 is obsolete| | --- Comment #29 from Blou <philippe.blouin@inlibro.com> --- Created attachment 64414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64414&action=edit Bug 18634: Handle colliding translation for preference sections Problem on this report was caused by translating the tabs Privacy and Payments by the same string. This caused overwriting a hash entry. This patch tests if the key already exists and if so, it merges the entries instead of overwriting the old contents. Test plan: [1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee. [2] Run translate install fr-CA (or the language you altered) [3] Without this patch you should loose preferences from either Privacy or Payments. With this patch, they should be merged. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fr-CA. Signed-off-by: Blou <philippe.blouin@inlibro.com> Reset the .po files, reproduced the problem. Applied the patch and suddenly 'paypal' appeared. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63550|0 |1 is obsolete| | --- Comment #30 from Blou <philippe.blouin@inlibro.com> --- Comment on attachment 63550 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63550 Bug 18634 - Missing empty line at end of opac.pref My patch was a solution, but not a fix to the problem. Marcel's patch is the real fix (IMO, at least :) ) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thanks Blou. Updating status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64414|0 |1 is obsolete| | --- Comment #32 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 64843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64843&action=edit Bug 18634: Handle colliding translation for preference sections Problem on this report was caused by translating the tabs Privacy and Payments by the same string. This caused overwriting a hash entry. This patch tests if the key already exists and if so, it merges the entries instead of overwriting the old contents. Test plan: [1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee. [2] Run translate install fr-CA (or the language you altered) [3] Without this patch you should loose preferences from either Privacy or Payments. With this patch, they should be merged. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fr-CA. Signed-off-by: Blou <philippe.blouin@inlibro.com> Reset the .po files, reproduced the problem. Applied the patch and suddenly 'paypal' appeared. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64843|0 |1 is obsolete| | --- Comment #33 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 64844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64844&action=edit Bug 18634: Handle colliding translation for preference sections Problem on this report was caused by translating the tabs Privacy and Payments by the same string. This caused overwriting a hash entry. This patch tests if the key already exists and if so, it merges the entries instead of overwriting the old contents. Test plan: [1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee. [2] Run translate install fr-CA (or the language you altered) [3] Without this patch you should loose preferences from either Privacy or Payments. With this patch, they should be merged. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fr-CA. Signed-off-by: Blou <philippe.blouin@inlibro.com> Reset the .po files, reproduced the problem. Applied the patch and suddenly 'paypal' appeared. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |julian.maurice@biblibre.com --- Comment #34 from Julian Maurice <julian.maurice@biblibre.com> --- There is a problem in how we handle translation here. IMO keys of a hash shouldn't be translatable. But the patch definitely fixes a problem, so passing QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #35 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to Master |Pushed to Stable --- Comment #36 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x, will be in 17.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #37 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.10. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18634 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #38 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.15 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org