Currently we use 0 to indicate an action performed by command line scripts (userenv is undef, default to 0) After bug 22008 we must have a real borrowernumber. If we simply default to 'NULL' we will no longer be able to differentiate fines from command line from those of deleted users
Created attachment 87069 [details] [review] Bug 22593: Fix bad ternaries after bug 22008 A series of ternaries were introduced when we moved to add_debit which defaulted to 'user 0' should a userenv not be set. This was incorrect as userenv may well not be set (during cronscript runs for example) and the new constraint would not allow such a default. We switch to 'undef' here to satisfy the constraint. Test plan 1) Ensure you have data in your system that would be caught by the longoverdues cronjob. 2) Ensure you're sysprefs are setup to charge for lost items 3) Run the script and varify it runs to completion without errors Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(In reply to Martin Renvoize from comment #0) > Currently we use 0 to indicate an action performed by command line scripts > (userenv is undef, default to 0) > > After bug 22008 we must have a real borrowernumber. > > If we simply default to 'NULL' we will no longer be able to differentiate > fines from command line from those of deleted users I believe that we can differentiate deleted users from cron users by the branchcode of the accountline - branch should remain for deleted user - I think if we deleted a branch we would want to delete the accountlines instead of NULL them also, but that is for elsewhere
Created attachment 87075 [details] [review] Bug 22593: Fix bad ternaries after bug 22008 A series of ternaries were introduced when we moved to add_debit which defaulted to 'user 0' should a userenv not be set. This was incorrect as userenv may well not be set (during cronscript runs for example) and the new constraint would not allow such a default. We switch to 'undef' here to satisfy the constraint. Test plan 1) Ensure you have data in your system that would be caught by the longoverdues cronjob. 2) Ensure you're sysprefs are setup to charge for lost items 3) Run the script and varify it runs to completion without errors Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 87130 [details] [review] Bug 22593: Fix bad ternaries after bug 22008 A series of ternaries were introduced when we moved to add_debit which defaulted to 'user 0' should a userenv not be set. This was incorrect as userenv may well not be set (during cronscript runs for example) and the new constraint would not allow such a default. We switch to 'undef' here to satisfy the constraint. Test plan 1) Ensure you have data in your system that would be caught by the longoverdues cronjob. 2) Ensure you're sysprefs are setup to charge for lost items 3) Run the script and varify it runs to completion without errors Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 19.05
Bug with enhancement not in 18.11.x series.