Summary: | smart-rules: Some rules can be created but are not visible on interface | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | System Administration | Assignee: | Bugs List <koha-bugs> |
Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, jonathan.druart, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35458 | ||
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: | 27945, 30794 | ||
Bug Blocks: | |||
Attachments: | Bug 32262: Handle non-existing circ rules |
Description
Marcel de Rooy
2022-11-18 10:05:58 UTC
Hum, CirculationRules.Search() never returns an undefined value and, more generally, methods from the TT plugins return an empty string when we actually return undef... Ok, perl returns an empty string for undef in a string context. Created attachment 144143 [details] [review] Bug 32262: Handle non-existing circ rules Some rules are not displayed on the UI, even if they exist in the DB, that's confusing. That's because we are implicitely returning 'undef' from CirculationRules.Search, and perl returns an empty string for undef in a string context. Which means "rules.defined" is always true. This patch is ugly and really hope somebody else will come with a better solution. Test plan: I don't know, search for regressions on the circ rule UI?... :D Note that want_rule flag could have unexpected behaviours |