https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Martin Renvoize from comment #11)
(In reply to Tomás Cohen Arazi from comment #6)
(In reply to Tomás Cohen Arazi from comment #5)
(In reply to Martin Renvoize from comment #4)
Sorry dude, not 100% sure of the construct here... I feel like 'safe_to_delete' should return a Boolean given it's method name?
Perhaps a boolean in scalar context and a Boolean + hash or array of errors as the second slot of an array in list context?
Maybe a Koha::Validation object that validates to a bool, and carries messages in it?
I replicated Koha::Item's to limit the conflict surface, but...hey... Hehe
I should have read more code for context, happy to stick with this as there's a precidence in Koha::Item.. I thought I'd seen something somewhere but couldn't place it. In the transfers work I threw exceptions and allowed a force option to be passed, but the use case isn't the same. I'd love to see us settle on something consistent.
I filed bug 29746, and provided an implementation. If I get feedback on that, I can re-do this using that which will be much cleaner. It could be done on a follow-up bug if required, and definitely should cover Koha::Item->safe_to_delete as well. -- You are receiving this mail because: You are watching all bug changes.