https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31727
--- Comment #1 from Andrew Nugged <[email protected]> --- On smart-rules.pl (Home > Administration > Circulation and fine rules): we have 7 tables: 1. Defining circulation and fine rules for all libraries (... for XXX branch, if branch selected) 2. Default checkout, hold and return policy (... for XXX branch, if branch selected) 3. Checkout, hold policy by patron category (... for XXX branch, if branch selected) 4. Daily open article requests limit (... for XXX branch, if branch selected) 5. Article request fees (... for XXX branch, if branch selected) 6. Lost item fee refund on return policy (... for XXX branch, if branch selected) 7. Holds policy by item type (... for XXX branch, if branch selected) and with dropdown, we can select rules for "Standard rules for all libraries" or switch to ANY of the available branches represented by the whole page. Attempt to fix missing values in Bug 29012 had the atomic update, which filled up the circulation_rules table with values if ANY combination of "branch+category+itemtype" was found in the circulation_rules table. This had false positives for items from above-mentioned table 2..7 when assumed that only key/value pairs from table 1 should be those which affect the decision to add or not" new empty or zeroed item. This made the problem: after this atomic update, we have the circulation_rules table randomly filled with orphan elements for "table 1" even if no rules in table 1 for that branch were present in real. Worse: those orphan items are never shown as rows of real rules for the operator so not visible. Bad: those orphan items, for example, "issuelength" of 0 when it has some BRANCH overlaps ANY rule without branches and discretely changes behavior when issuing items. EXAMPLE: - Open smart-rules.pl and choose in the first dropdown "Select a library : " some BRANCH_NAME so this page will reload into BRANCH_NAME-targeted mode for the whole page. - Edit the second table "Default checkout, hold and return policy for BRANCH_NAME" making value holdallowed to be set into something, and save it. You will see / still have "table 1" empty. At this time key/value pair will be added to the database for this BRANCH_NAME, and this is exactly what later will mislead that atomic update: - make the atomic update from Bug 29012 to fill those "zeroes and empties" - check the smart-rules.pl page for BRANCH_NAME-targeted mode: there will still be no rules in the 1st, "Defining circulation and fine rules for XXX branch" table, - but now check the database in raw mode: you will see that there will be a record: BRANCH_NAME will have, for example, "issuelength" of 0 key/value pair. - OUCH! What to fix: Now we need to invent a new atomic update to be applied after this one (and this is very non-trivial because we somehow need to preserve other proper values), to fix the database from orphan values. This anyway can lead to very unpredictable results. Another thing to consider is that we should even if unsure what is orphans - is to reveal all hidden values, i.e. append and populate other values to make a "full row" appear for the operator in the interface, so at least human can SEE wrong with those rules and then decide/delete but make impossible to have "remnants" and orphans hidden. PROBLEM 2: unseen_renewals_allowed vs unseenrenewalsallowed (sic!) we have 'unseen_renewals_allowed' everywhere in the codebase, except in this atomic update we have 'unseenrenewalsallowed'. And now DB is polluted even more :). This also should be fixed - and more: we might now have unseen_renewals_allowed and unseenrenewalsallowed both in database. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
