Bug 19977

Summary: Local Use tab in systempreferences tries to open text editor's temporary files, and die
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: System AdministrationAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Nick Clemens <nick>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, mtompset, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19977: Open only .pref files in Local Use tab (sysprefs)
Bug 19977: Open only .pref files in Local Use tab (sysprefs)
Bug 19977: Open only .pref files in Local Use tab (sysprefs)

Description Julian Maurice 2018-01-16 09:19:26 UTC
Steps to reproduce:
1. Open koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref with vim (check that it creates a .circulation.pref.swp in the same directory)
2. Go to the "Local Use" tab in admin/systempreferences.pl
3. Observe the error: Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use at /home/koha/koha/admin/systempreferences.pl line 413.
Comment 1 Julian Maurice 2018-01-16 09:23:53 UTC
Created attachment 70548 [details] [review]
Bug 19977: Open only .pref files in Local Use tab (sysprefs)

Test plan:
1. Open .../prog/en/modules/admin/preferences/circulation.pref
with vim (check that it creates a .circulation.pref.swp in the same
directory)
2. Go to the "Local Use" tab in admin/systempreferences.pl
3. Confirm that the page works normally
Comment 2 Mark Tompsett 2018-01-18 17:48:47 UTC
One would hope this case never happens. And if it does, stop editing the files on a live system. That being said, this is a straight-forward regexp tightening.
Comment 3 Mark Tompsett 2018-01-18 17:54:24 UTC
Created attachment 70703 [details] [review]
Bug 19977: Open only .pref files in Local Use tab (sysprefs)

Test plan:
1. Open .../prog/en/modules/admin/preferences/circulation.pref
with vim (check that it creates a .circulation.pref.swp in the same
directory)
2. Go to the "Local Use" tab in admin/systempreferences.pl
3. Confirm that the page works normally

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Julian Maurice 2018-01-19 11:03:04 UTC
(In reply to M. Tompsett from comment #2)
> One would hope this case never happens. And if it does, stop editing the
> files on a live system. That being said, this is a straight-forward regexp
> tightening.

Of course this should never happen in production, but it can be annoying during development.
Thanks for the sign-off!
Comment 5 Nick Clemens 2018-01-19 14:54:01 UTC
Created attachment 70749 [details] [review]
Bug 19977: Open only .pref files in Local Use tab (sysprefs)

Test plan:
1. Open .../prog/en/modules/admin/preferences/circulation.pref
with vim (check that it creates a .circulation.pref.swp in the same
directory)
2. Go to the "Local Use" tab in admin/systempreferences.pl
3. Confirm that the page works normally

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2018-01-19 18:56:36 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2018-01-23 04:11:20 UTC
Awesome work all!

Pushed to Stable for 17.11.02
Comment 8 Fridolin Somers 2018-01-31 07:55:54 UTC
Pushed to 17.05.x for v17.05.09