Summary: | Borrower permissions are broken by update from bug 22868 | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Patrons | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | blocker | ||
Priority: | P1 - high | CC: | aleisha, didier.gautheron, gmcharlt, jonathan.druart, julian.maurice, kyle.m.hall, lucas, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00, 20.05.02, 19.11.08, 19.05.13
|
|
Circulation function: | |||
Bug Depends on: | 22868 | ||
Bug Blocks: | |||
Attachments: |
Bug 25858: Don't attempt to set flag if already set
Bug 25858: Don't attempt to set flag if already set Bug 25858: Don't attempt to set flag if already set Bug 25858: Use bitwise OR for setting a bit in borrowers.flag |
Description
Nick Clemens (kidclamp)
2020-06-23 19:12:16 UTC
Created attachment 106240 [details] [review] Bug 25858: Don't attempt to set flag if already set Hi Why not use & | and ^ ? UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) Regards Didier (In reply to didier from comment #2) > Hi > > Why not use & | and ^ ? > > UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) > > Regards > Didier That is much more concise, I am not sure if it is clearer, but I am happy to have either solution, we just need to get this fixed Created attachment 106282 [details] [review] Bug 25858: Don't attempt to set flag if already set Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com> (In reply to Nick Clemens from comment #3) > (In reply to didier from comment #2) > > Hi > > > > Why not use & | and ^ ? > > > > UPDATE borrowers SET flags = flags | (1<<12) WHERE flags & (1 << 11) > > > > Regards > > Didier > > That is much more concise, I am not sure if it is clearer, but I am happy to > have either solution, we just need to get this fixed I confirm both solutions work, but in my opinion Didier's solution is more clear about what the intention is. I'll provide a followup Created attachment 106314 [details] [review] Bug 25858: Don't attempt to set flag if already set Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Created attachment 106315 [details] [review] Bug 25858: Use bitwise OR for setting a bit in borrowers.flag Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com> Looks like it is impossible to add a new update DB entry to fix this problem :-/ Pushed to master for 20.11, thanks to everybody involved! backported to 20.05.x for 20.05.02 backported to 19.11.x for 19.11.08 Backported to 19.05.x branch for 19.05.13 |