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 Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Password Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Restriction Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Attribute.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Attributes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Categories.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Category.pm Bug 3492: Add hold fees to circulation rules system 2026-02-09 12:57:55 -07:00
Consent.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Consents.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Debarments.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Discharge.pm Bug 40458: add pod coverage to Discharge.pm 2025-07-21 14:01:34 -06:00
Files.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundProfile.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundProfiles.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundRole.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundRoles.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundVisit.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HouseboundVisits.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Image.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Images.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Message.pm Bug 41818: Add new Koha::Patron::Message method to SIP2 2026-02-26 09:04:12 -07:00
MessagePreference.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
MessagePreferences.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Messages.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Modification.pm Bug 19871: (QA follow-up) Remove safe_do, use translate_exception directly 2026-04-23 16:04:19 -06:00
Modifications.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Relationship.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Relationships.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Restriction.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Restrictions.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00