Bug 23396

Summary: Rancor fails to load: insert_copyright is not defined
Product: Koha Reporter: Cori Lynn Arnold <carnold>
Component: Installation and upgrade (web-based installer)Assignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: critical    
Priority: P5 - low CC: fridolin.somers, gmcharlt, katrin.fischer, tomascohen
Version: 19.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03
Bug Depends on: 17178, 21411    
Bug Blocks:    
Attachments: Screenshot from Chrome
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm
Bug 23396: (QA follow-up) Add atomic update

Description Cori Lynn Arnold 2019-07-29 15:26:48 UTC
Created attachment 91854 [details]
Screenshot from Chrome

The Advanced Editor fails to load on 19.05 with the error message:

marc-editor.js:140 Uncaught ReferenceError: insert_copyright is not defined
    at marc-editor.js:140
    at Object.execCb (require_19.0502000.js:29)
    at X.check (require_19.0502000.js:18)
    at X.<anonymous> (require_19.0502000.js:23)
    at require_19.0502000.js:8
    at require_19.0502000.js:23
    at y (require_19.0502000.js:7)
    at X.emit (require_19.0502000.js:23)
    at X.check (require_19.0502000.js:19)
    at X.<anonymous> (require_19.0502000.js:23)

used Chrome and Firefox.
Comment 1 Owen Leonard 2019-07-29 16:43:35 UTC
This bug only happened for me when starting with a blank database. I tested with 16.11.x and 18.11.x databases and didn't get the error.
Comment 2 Nick Clemens 2019-07-30 13:39:51 UTC
Created attachment 91873 [details] [review]
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm

To test:
1 - Back up your DB if you want to save it
2 - sudo koha-mysql kohadev
    DROP database koha_kohadev;
    CREATE database koha_kohadev;
3 - http://localhost:8081
4 - Go through the web installer
5 - Enable AdvancedCatalogingEditor
6 - Try to load it, fails with JS console error: insert_copyright is not defined
7 - Apply patch
8 - Repeat
9 - This time editor loads
Comment 3 Katrin Fischer 2019-07-30 20:57:27 UTC
Created attachment 91886 [details] [review]
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm

To test:
1 - Back up your DB if you want to save it
2 - sudo koha-mysql kohadev
    DROP database koha_kohadev;
    CREATE database koha_kohadev;
3 - http://localhost:8081
4 - Go through the web installer
5 - Enable AdvancedCatalogingEditor
6 - Try to load it, fails with JS console error: insert_copyright is not defined
7 - Apply patch
8 - Repeat
9 - This time editor loads

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-08-02 05:54:23 UTC
Should we add an update database entry to fix this for existing installations?
Comment 5 Katrin Fischer 2019-08-02 05:56:52 UTC
(In reply to Katrin Fischer from comment #4)
> Should we add an update database entry to fix this for existing
> installations?

I think we should. We already got people installing 19.05 for production use and we could just repeat the initial database update from introducing the feature with a check for data already being there.
Comment 6 Tomás Cohen Arazi 2019-08-02 18:55:53 UTC
Created attachment 91937 [details] [review]
Bug 23396: Add keyboard_shortcuts.sql to C4/Installer.pm

To test:
1 - Back up your DB if you want to save it
2 - sudo koha-mysql kohadev
    DROP database koha_kohadev;
    CREATE database koha_kohadev;
3 - http://localhost:8081
4 - Go through the web installer
5 - Enable AdvancedCatalogingEditor
6 - Try to load it, fails with JS console error: insert_copyright is not defined
7 - Apply patch
8 - Repeat
9 - This time editor loads

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi 2019-08-02 18:55:57 UTC
Created attachment 91938 [details] [review]
Bug 23396: (QA follow-up) Add atomic update

New installs before the fix won't have the table populated, this patch
adds a fix for that, including the shortcut added by bug 17178.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Martin Renvoize 2019-08-05 10:40:23 UTC
Nice work!

Pushed to master for 19.11.00
Comment 9 Fridolin Somers 2019-08-09 13:14:36 UTC
Pushed to 19.05.x for 19.05.03

Since Bug 17178 is not in 19.05.x I have added a commit :
  Bug 23396: (19.05.x) remove toggle_keyboard comming from Bug 17178