Bugzilla – Attachment 186647 Details for
Bug 19871
Use new exceptions Koha::Exceptions::Object::DuplicateID and FKConstraint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19871: Update virtualshelf templates to use Koha exceptions instead of DBIx::Class::Exception
Bug-19871-Update-virtualshelf-templates-to-use-Koh.patch (text/plain), 3.59 KB, created by
Martin Renvoize (ashimema)
on 2025-09-21 15:15:06 UTC
(
hide
)
Description:
Bug 19871: Update virtualshelf templates to use Koha exceptions instead of DBIx::Class::Exception
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-09-21 15:15:06 UTC
Size:
3.59 KB
patch
obsolete
>From 6f2be2594eeb161a95f76a4eee247392f7d493b6 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Sun, 21 Sep 2025 15:35:09 +0100 >Subject: [PATCH] Bug 19871: Update virtualshelf templates to use Koha > exceptions instead of DBIx::Class::Exception > >Replace DBIx::Class::Exception handling in shelf templates with specific >Koha exception types that are now provided by the centralized exception >translation system. > >Template changes: >- Replace 'DBIx::Class::Exception' case with specific Koha exception handlers >- Add user-friendly error messages for FKConstraint, DuplicateID, and BadValue >- Improve error presentation with descriptive text instead of raw database errors > >This provides better user experience by showing meaningful error messages >instead of technical database exception details. >--- > .../prog/en/modules/virtualshelves/shelves.tt | 8 ++++++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 8 ++++++-- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index cf5f68b3e19..0c173b89c83 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -191,8 +191,12 @@ > <span>An error occurred when creating this list. The name [% shelfname | html %] already exists.</span> > [% CASE 'Koha::Exceptions::Virtualshelf::UseDbAdminAccount' %] > <span>List could not be created. (Do not use the database administrator account.)</span> >- [% CASE 'DBIx::Class::Exception' %] >- [% m.msg | html %] >+ [% CASE 'Koha::Exceptions::Object::FKConstraint' %] >+ <span>Database constraint error: [% m.msg | html %]</span> >+ [% CASE 'Koha::Exceptions::Object::DuplicateID' %] >+ <span>Duplicate entry error: [% m.msg | html %]</span> >+ [% CASE 'Koha::Exceptions::Object::BadValue' %] >+ <span>Invalid data error: [% m.msg | html %]</span> > [% CASE %] > [% m.code | html %] > [% m.msg | html %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 875a88da234..8e3a3bbe760 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -210,8 +210,12 @@ > <span>The new owner has no share for this list.</span> > [% CASE 'Koha::Exceptions::Virtualshelf::DuplicateObject' %] > <span>An error occurred when creating the list. The name [% shelfname | html %] already exists.</span> >- [% CASE 'DBIx::Class::Exception' %] >- [% m.msg | html %] >+ [% CASE 'Koha::Exceptions::Object::FKConstraint' %] >+ <span>Database constraint error: [% m.msg | html %]</span> >+ [% CASE 'Koha::Exceptions::Object::DuplicateID' %] >+ <span>Duplicate entry error: [% m.msg | html %]</span> >+ [% CASE 'Koha::Exceptions::Object::BadValue' %] >+ <span>Invalid data error: [% m.msg | html %]</span> > [% CASE %] > [% m.code | html %] > [% m.msg | html %] >-- >2.51.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19871
:
186634
|
186635
|
186644
|
186645
|
186646
| 186647 |
186648
|
186649
|
186650