Summary: | warning: "sort (...) interpreted as function" when running updatedatabase | ||
---|---|---|---|
Product: | Koha | Reporter: | Victor Grousset/tuxayo <victor> |
Component: | Installation and upgrade (command-line installer) | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 38664 | ||
Bug Blocks: |
Description
Victor Grousset/tuxayo
2025-02-11 22:04:04 UTC
So I guess it can be fixed either by looking at that weird perl behavior. Or by fixing that old DB rev so it actually gets the max_date. Assuming that's correct functionally. A fix might change the code enough to avoid the weird warning. Just reversing the sort with { $b cmp $a } avoids the warning ^^" my ($max_value2) = sort { $b cmp $a } ( $var_with_long_name_1, $var_with_long_name_2, $var_with_long_name_3 ); ---- Should severity be major because it might cause doubt on whether upgrade failed or worked? Done in bug 38664: Fix updatedatabase.pl *** This bug has been marked as a duplicate of bug 38664 *** Thanks for the fix in bug 38664 comment 48 :) > my ($max_date) = sort { $a cmp $b } ( Note that with "{ $a cmp $b} " it's still sorting ascendingly which would give a min_date and not max_date. But we would have to do more testing on that old db rev from 2019. Whose wrongness got unnoticed to this day. So I guess we can not bother with it. well yes, indeed. I was focus on submitting something that won't change the behaviour and didn't notice that the behaviour was wrong. At least there is no change :D IMO it's too late to change that, especially if nobody noticed yet... |