Koha-clms/Koha/Patron
Tomás Cohen Arazi e7b258bdb7
Bug 19871: (QA follow-up) Remove safe_do, use translate_exception directly
The safe_do wrapper adds indirection without value:

- In Patron::Modification::approve, every operation inside safe_do
  goes through Object::store or Object::delete, which already call
  translate_exception internally. The wrapper was translating
  already-translated exceptions.

- In Item::add_to_bundle, the outer try/catch just called rethrow,
  making the safe_do + try/catch nesting a no-op.

This follow-up removes safe_do and aligns both callers with the
pattern already used by Object::store and Object::delete: call
translate_exception directly in the catch block when raw DBIC
operations are involved.

Changes:
- Remove safe_do from Koha::Schema (and its Try::Tiny import)
- Flatten add_to_bundle to use translate_exception in its catch
- Flatten Patron::Modification::approve to rely on Object::store
- Remove safe_do test, adjust test count

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-23 16:04:19 -06:00
..
Attribute Bug 39971: Add query param 2026-01-30 10:54:25 -07:00
MessagePreference
…
Password Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Restriction
…
Attribute.pm
…
Attributes.pm
…
Categories.pm
…
Category.pm Bug 3492: Add hold fees to circulation rules system 2026-02-09 12:57:55 -07:00
Consent.pm
…
Consents.pm
…
Debarments.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Discharge.pm
…
Files.pm
…
HouseboundProfile.pm
…
HouseboundProfiles.pm
…
HouseboundRole.pm
…
HouseboundRoles.pm
…
HouseboundVisit.pm
…
HouseboundVisits.pm
…
Image.pm
…
Images.pm
…
Message.pm Bug 41818: Add new Koha::Patron::Message method to SIP2 2026-02-26 09:04:12 -07:00
MessagePreference.pm
…
MessagePreferences.pm
…
Messages.pm
…
Modification.pm Bug 19871: (QA follow-up) Remove safe_do, use translate_exception directly 2026-04-23 16:04:19 -06:00
Modifications.pm
…
Relationship.pm
…
Relationships.pm
…
Restriction.pm
…
Restrictions.pm
…