Bug 32104 - Console error on additional_content.pl after saving
Summary: Console error on additional_content.pl after saving
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-03 21:27 UTC by Lucas Gass
Modified: 2023-06-08 22:28 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 32104: Prevent console error on additonal-contents.pl (1.39 KB, patch)
2022-11-03 22:22 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 32104: Prevent console error on additonal-contents.pl (1.43 KB, patch)
2022-11-04 08:08 UTC, David Nind
Details | Diff | Splinter Review
Bug 32104: Prevent console error on additonal-contents.pl (1.49 KB, patch)
2022-11-17 18:03 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-11-03 21:27:17 UTC
To recreate:
1. Make a new HTML customization, news item, or page with the text editor ( CodeMirror ). 
2. Save the content ( not Save and continue )
3. Notice the console error:

Uncaught TypeError: firstTab[0] is undefined

This only seems to happen for me when using CodeMirror. Using the WYSIWYG editor does not produce the console error.
Comment 1 Lucas Gass 2022-11-03 22:22:33 UTC
Created attachment 143154 [details] [review]
Bug 32104: Prevent console error on additonal-contents.pl

To test:
1. Make a new HTML customization, news item, or page with the text editor ( CodeMirror ).
2. Save the content ( not Save and continue )
3. Notice the console error:
4. Apply patch
5. Try 1 & 2 again.
6. No error.
Comment 2 David Nind 2022-11-04 08:08:01 UTC
Created attachment 143164 [details] [review]
Bug 32104: Prevent console error on additonal-contents.pl

To test:
1. Make a new HTML customization, news item, or page with the text editor ( CodeMirror ).
2. Save the content ( not Save and continue )
3. Notice the console error:
4. Apply patch
5. Try 1 & 2 again.
6. No error.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2022-11-09 23:12:02 UTC
I didn't see the console error on master - could you please verify if maybe bug 31609 fixed this?
Comment 4 Lucas Gass 2022-11-10 00:42:27 UTC
(In reply to Katrin Fischer from comment #3)
> I didn't see the console error on master - could you please verify if maybe
> bug 31609 fixed this?

It did not, the console error remains.
Comment 5 Katrin Fischer 2022-11-10 00:43:15 UTC
I couldn't make it happen when I tried earlier, maybe another set of eyes would help.
Comment 6 Lucas Gass 2022-11-10 00:45:22 UTC
It looks like I can only make the error happen when using Firefox.
Comment 7 Katrin Fischer 2022-11-10 00:46:07 UTC
(In reply to Lucas Gass from comment #6)
> It looks like I can only make the error happen when using Firefox.

Hm I did use Firefox :(
Comment 8 Jonathan Druart 2022-11-11 13:53:03 UTC
Same for me, I don't get the error (using Firefox).
Comment 9 Lucas Gass 2022-11-16 15:57:32 UTC
(In reply to Jonathan Druart from comment #8)
> Same for me, I don't get the error (using Firefox).

Interesting! Not quite sure what is going on here.
Comment 10 Tomás Cohen Arazi 2022-11-17 18:03:55 UTC
Created attachment 144021 [details] [review]
Bug 32104: Prevent console error on additonal-contents.pl

To test:
1. Make a new HTML customization, news item, or page with the text editor ( CodeMirror ).
2. Save the content ( not Save and continue )
3. Notice the console error:
4. Apply patch
5. Try 1 & 2 again.
6. No error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi 2022-11-17 18:04:39 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 12 Jonathan Druart 2022-11-18 05:50:56 UTC
(In reply to Tomás Cohen Arazi from comment #11)
> Pushed to master for 22.11.

Did you get the warning?