Incorrect typing when encoding some values as JSON
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.6 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
EG 3.7 beta
Ubuntu 20.04
Perl 5.30.0
In some cases, Perl values are encoded as JSON with the wrong datatype. This can lead to unexpected behavior.
For example, open-ils.
That's just one example. We will likely find other instances, since the behavior appears to be due to a recent change in how Perl handles scalar(@array) in some contexts. There has been some discussion in IRC:
http://
http://
Perl 5.26 and earlier do not appear to be affected, so these issues should not arise on Ubuntu 18.04 and earlier.
We can address the issue in Evergreen by finding affected instances of scalar(@array) and changing them to something like int(scalar(
Changed in evergreen: | |
milestone: | none → 3.7-beta2 |
Changed in evergreen: | |
assignee: | nobody → Jason Stephenson (jstephenson) |
Changed in evergreen: | |
milestone: | 3.7-rc → 3.7.1 |
tags: | added: pullrequest |
Changed in evergreen: | |
milestone: | 3.7.1 → 3.7.2 |
Changed in evergreen: | |
assignee: | nobody → Mike Rylander (mrylander) |
no longer affects: | evergreen/3.5 |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Working branch user/jeffdavis/ lp1923076- numify- scalar has a fix for the hold count example, wrapping scalar() in int() as suggested by Jason Stephenson:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ jeffdavis/ lp1923076- numify- scalar
Test plan:
1. Install EG on Ubuntu 20.04 or some other OS using Perl 5.28 or later.
2. In the web client, retrieve a patron who has no holds ready and no other alerts. You will get a blank alert (a STOP sign with no alert message), which must be cleared before doing anything else.
3. Apply the patch and restart Evergreen.
4. Clear local storage and retrieve the patron again. This time there should be no alert.