Bug 24734

Summary: LangInstaller is looking in wrong directory for js files
Product: Koha Reporter: paxed <pasi.kallinen>
Component: I18N/L10NAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: 1joynelson, bgkriegel, f.demians, julian.maurice, katrin.fischer, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24664
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.04
Bug Depends on:    
Bug Blocks: 21156    
Attachments: Bug 24734: Fix paths in LangInstaller.pm for JS files
Bug 24734: Fix paths in LangInstaller.pm for JS files
Bug 24734: Fix paths in LangInstaller.pm for JS files

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