actor.org_unit_full_path() discards the assumed row output order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.4 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Evergreen version: all supported
Postgres version: 9.6 confirmed, probably all
This was originally identified and reported by Erica Rohlfs here at Equinox.
Some code, including UI rendering code in the reporting interfaces, assumes that the order of the full_path stored procedure will be the same as for the ancestors and descendants procedures, which is tree order from top to bottom. However, because the full_path procedure simply UNIONs the other two together without an explicit ORDER BY, that may not be -- and for org hierarchies that have been modified heavily, often is not -- the case in practice. This is due to internals of query planning in Postgres.
The easiest place to see this issues is in the report interface. Select a template folder that is not currently shared, choose Manage Folder, select Share Folder, click Go, and see the dropdown of options. Under some circumstances, the list of org units in the dropdown there are incorrectly ordered (should be from top of the tree down), and some that should be available are disabled.
Watch this space for a forthcoming branch that restores the truth of that assumption by providing an appropriate ORDER BY clause.
Changed in evergreen: | |
milestone: | 3.4.2 → 3.4.3 |
Changed in evergreen: | |
milestone: | 3.4.3 → 3.4.4 |
Changed in evergreen: | |
milestone: | 3.4.4 → 3.5.2 |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Branch addressing this is available at:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ miker/lp- 1851413- full_path_ output_ order