Bug 18727 - System preferences loose part of values because of double quotes
Summary: System preferences loose part of values because of double quotes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
: 9814 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-05 04:15 UTC by Marc Véron
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Bug 18727: System preferences loose part of values because of double quotes (3.89 KB, patch)
2017-06-05 05:18 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18727: System preferences loose part of values because of double quotes (3.96 KB, patch)
2017-06-05 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18727: System preferences loose part of values because of double quotes (4.03 KB, patch)
2017-06-09 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-06-05 04:15:27 UTC
The system preferences AcqItemSetSubfieldsWhenReceiptIsCancelled and AcqItemSetSubfieldsWhenReceived loose part of their values because of double quotes.
To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
-  Result: Both preferences show a value of: o=5|a= 
  (parts with double quotes are truncated)
Comment 1 Marc Véron 2017-06-05 04:48:07 UTC
The problem occurs with all system preferences containing double quotes as values. The values are correct in the database but are truncated if edited again.

Other example is Bug 9814 - KohaAdminEmailAddress syspref webpage field doesn't handle double quotes.
Comment 2 Marc Véron 2017-06-05 05:18:48 UTC
Created attachment 63956 [details] [review]
Bug 18727: System preferences loose part of values because of double quotes

System preferences do not display values of text fields properly if they
contain doulbe quotes.

To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
  (parts with double quotes are truncated)

- Edit any of the email addresses (Bug 9814):
  KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
  Use [     ] " autocomplete="off" /> as the email address for the
  administrator of Koha.

To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
  quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"

(Note: patch contains a tiny fix for a typo in acquisitions.pref)
Comment 3 Marc Véron 2017-06-05 05:22:37 UTC
Setting to major because users can unintentionally change system preferences to mutilated values.
Comment 4 Marc Véron 2017-06-05 05:23:22 UTC
*** Bug 9814 has been marked as a duplicate of this bug. ***
Comment 5 Josef Moravec 2017-06-05 10:32:43 UTC
Created attachment 63958 [details] [review]
[SIGNED-OFF] Bug 18727: System preferences loose part of values because of double quotes

System preferences do not display values of text fields properly if they
contain doulbe quotes.

To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
  (parts with double quotes are truncated)

- Edit any of the email addresses (Bug 9814):
  KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
  Use [     ] " autocomplete="off" /> as the email address for the
  administrator of Koha.

To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
  quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"

(Note: patch contains a tiny fix for a typo in acquisitions.pref)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Jonathan Druart 2017-06-09 14:53:19 UTC
Created attachment 64144 [details] [review]
Bug 18727: System preferences loose part of values because of double quotes

System preferences do not display values of text fields properly if they
contain doulbe quotes.

To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and  o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
  (parts with double quotes are truncated)

- Edit any of the email addresses (Bug 9814):
  KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
  Use [     ] " autocomplete="off" /> as the email address for the
  administrator of Koha.

To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
  quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"

(Note: patch contains a tiny fix for a typo in acquisitions.pref)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2017-06-09 15:48:09 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-06-12 10:28:48 UTC
Pushed to 17.05.x, will be in 17.05.01
Comment 9 Katrin Fischer 2017-06-13 06:01:00 UTC
This patch has been pushed to 16.11.x and will be in 16.11.09.
Comment 10 Mason James 2017-07-31 11:21:19 UTC
Pushed to 16.05.x, for 16.05.15 release