Bug 24734 - LangInstaller is looking in wrong directory for js files
Summary: LangInstaller is looking in wrong directory for js files
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 21156
  Show dependency treegraph
 
Reported: 2020-02-26 10:22 UTC by paxed
Modified: 2020-03-18 16:17 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.04


Attachments
Bug 24734: Fix paths in LangInstaller.pm for JS files (1.13 KB, patch)
2020-02-26 19:13 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24734: Fix paths in LangInstaller.pm for JS files (1.28 KB, patch)
2020-02-26 19:40 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 24734: Fix paths in LangInstaller.pm for JS files (1.34 KB, patch)
2020-02-29 11:19 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2020-02-26 10:22:37 UTC
On all-default-settings Koha install, running translate update fi-FI gives me this:

Can't stat /usr/share/koha/intranet/cgi-bin/koha-tmpl/intranet-tmpl/prog/js: No such file or directory
 at /usr/share/koha/misc/translator/LangInstaller.pm line 715.
Can't stat /usr/share/koha/intranet/cgi-bin/koha-tmpl/opac-tmpl/bootstrap/js: No such file or directory
 at /usr/share/koha/misc/translator/LangInstaller.pm line 715.
/usr/bin/xgettext: no input file given

Looks like LangInstaller.pm is looking in the wrong dir for the javascript files, @js_dirs is set to
 
-        "$intranetdir/koha-tmpl/intranet-tmpl/prog/js",
-        "$intranetdir/koha-tmpl/opac-tmpl/bootstrap/js",

when it should be using

+        "$intrahtdocs/prog/js",
+        "$opachtdocs/bootstrap/js",


Compare @js_dirs with @intranet_tt_files and @opac_tt_files in LangInstaller.
Comment 1 Bernardo Gonzalez Kriegel 2020-02-26 13:33:53 UTC
> Looks like LangInstaller.pm is looking in the wrong dir for the javascript
> files, @js_dirs is set to
>  
> -        "$intranetdir/koha-tmpl/intranet-tmpl/prog/js",
> -        "$intranetdir/koha-tmpl/opac-tmpl/bootstrap/js",
> 
> when it should be using
> 
> +        "$intrahtdocs/prog/js",
> +        "$opachtdocs/bootstrap/js",
> 
> 
> Compare @js_dirs with @intranet_tt_files and @opac_tt_files in LangInstaller.

You  are right, good catch!
That lines belong to Bug 21156, already on master but can be fixed :)
They work on a git/dev install but not on a normal one.

Will you write the patch?
Comment 2 Julian Maurice 2020-02-26 19:13:09 UTC
Created attachment 99674 [details] [review]
Bug 24734: Fix paths in LangInstaller.pm for JS files

Use intrahtdocs and opachtdocs in order to get the correct paths for all
kind of installations

Test plan:
1. With a dev install, run ./translator create/update/install xx-XX and
   verify that there is no error message
2. With a standard install, run ./translator create/update/install xx-XX
   and verify that there is no error message
Comment 3 Bernardo Gonzalez Kriegel 2020-02-26 19:40:52 UTC
Created attachment 99675 [details] [review]
Bug 24734: Fix paths in LangInstaller.pm for JS files

Use intrahtdocs and opachtdocs in order to get the correct paths for all
kind of installations

Test plan:
1. With a dev install, run ./translator create/update/install xx-XX and
   verify that there is no error message
2. With a standard install, run ./translator create/update/install xx-XX
   and verify that there is no error message

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested for dev/single/standard installs, no errors,
just a (normal) warn from po2json.
Comment 4 Katrin Fischer 2020-02-29 11:18:30 UTC
There are still some issues, but I believe htem to be unrelated to this patch:

koha-tmpl/intranet-tmpl/prog/js/checkouts.js:569: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:858: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:904: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:911: warning: unterminated string
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1095: warning: RegExp literal terminated too early
Comment 5 Katrin Fischer 2020-02-29 11:19:49 UTC
Created attachment 99813 [details] [review]
Bug 24734: Fix paths in LangInstaller.pm for JS files

Use intrahtdocs and opachtdocs in order to get the correct paths for all
kind of installations

Test plan:
1. With a dev install, run ./translator create/update/install xx-XX and
   verify that there is no error message
2. With a standard install, run ./translator create/update/install xx-XX
   and verify that there is no error message

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested for dev/single/standard installs, no errors,
just a (normal) warn from po2json.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2020-02-29 11:21:17 UTC
(In reply to Katrin Fischer from comment #4)
> There are still some issues, but I believe htem to be unrelated to this
> patch:
> 
> koha-tmpl/intranet-tmpl/prog/js/checkouts.js:569: warning: unterminated
> string
> koha-tmpl/intranet-tmpl/prog/js/checkouts.js:858: warning: unterminated
> string
> koha-tmpl/intranet-tmpl/prog/js/checkouts.js:904: warning: unterminated
> string
> koha-tmpl/intranet-tmpl/prog/js/checkouts.js:911: warning: unterminated
> string
> koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1095: warning: RegExp literal
> terminated too early

Found the bug for those - bug 24725.
Comment 7 Martin Renvoize 2020-03-02 09:47:40 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-03-05 23:41:16 UTC
Pushed to 19.11.x branch for 19.11.04
Comment 9 Lucas Gass 2020-03-18 16:17:34 UTC
This patch will not apply cleanly to 19.05.x, not backporting