Bug 31623 - Greater/smaller than in DB password is problematic
Summary: Greater/smaller than in DB password is problematic
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-26 11:52 UTC by Magnus Enger
Modified: 2024-07-23 04:00 UTC (History)
3 users (show)

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


Attachments
Bug 31623: Link a suggestion to an existing order (7.60 KB, patch)
2024-07-23 03:46 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2022-09-26 11:52:53 UTC
To reproduce: 

Edit the koha-conf.xml of an existing site, by adding an element like this to the "config"-section (on the same level as the "database", "hostname" etc element): 

<passtest>a>b</passtest>

Now read this element in the same way koha-mysql does: 

$ sudo xmlstarlet sel -t -v 'yazgfs/config/passtest' /etc/koha/sites/koha/koha-conf.xml 
a&gt;b

"a>b" is output as "a&gt;b", which means koha-mysql will not be able to connect to the database.
Comment 1 Aleisha Amohia 2024-07-23 03:46:42 UTC
Created attachment 169390 [details] [review]
Bug 31623: Link a suggestion to an existing order

This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion.

To test:

1) In the staff interface, go to Suggestions and create at least two suggestions.
2) Mark at least two suggestions as Accepted.
3) Go to Acquisitions, create a vendor if you don't have one already.
4) Have or create two baskets - one should be standing, and one not standing (normal).
5) In the normal basket (not standing), add an order from any source but NOT from a suggestion.
6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this.
7) Choose one of your suggestions to link to the order.
8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked.
9) Add another order to this basket from any source but NOT from a suggestion.
10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to.
11) Go to Baskets in the left navigation so you can find your standing basket.
12) Add an order to your standing basket from any source but NOT from a suggestion.
13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving.
14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this.
15) Choose a suggestion to link to the order.
16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion.

Sponsored-by: Pymble Ladies' College
Comment 2 Aleisha Amohia 2024-07-23 03:47:59 UTC
Comment on attachment 169390 [details] [review]
Bug 31623: Link a suggestion to an existing order

Sorry, wrong bug number!
Comment 3 David Cook 2024-07-23 04:00:11 UTC
That's quite interesting.

Technically ">" is a reserved character, although in this case xmlstarlet outputs the escaped version whether or not you escape it in the XML file itself. Interesting!

The following works:

sudo xmlstarlet sel -t -v  'yazgfs/config/passtest' /etc/koha/sites/kohadev/koha-conf.xml | xmlstarlet unesc -

But I think the safest thing is just not to use reserved characters in XML values. I imagine different XML parsers might have different behaviours as well...