Bugzilla – Attachment 160175 Details for
Bug 35625
Add support for system flag to additional fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35625: Prevent deletion at controller
Bug-35625-Prevent-deletion-at-controller.patch (text/plain), 1.43 KB, created by
Martin Renvoize (ashimema)
on 2023-12-21 09:49:20 UTC
(
hide
)
Description:
Bug 35625: Prevent deletion at controller
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-21 09:49:20 UTC
Size:
1.43 KB
patch
obsolete
>From 39ef2c6de6efbfa6476e2f3f05d7491761162a31 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 21 Dec 2023 09:45:26 +0000 >Subject: [PATCH] Bug 35625: Prevent deletion at controller > >--- > admin/additional-fields.pl | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/admin/additional-fields.pl b/admin/additional-fields.pl >index 5efcfc7a77e..ab5b172a9a8 100755 >--- a/admin/additional-fields.pl >+++ b/admin/additional-fields.pl >@@ -67,8 +67,10 @@ if ( $op eq 'add' ) { > > eval { > my $af = Koha::AdditionalFields->find($field_id); >- $af->set($set_fields); >- $updated = $af->store ? 1 : 0; >+ if ( !$af->is_system ) { >+ $af->set($set_fields); >+ $updated = $af->store ? 1 : 0; >+ } > }; > push @messages, { > code => 'update', >@@ -107,7 +109,9 @@ if ( $op eq 'delete' ) { > my $deleted = 0; > eval { > my $af = Koha::AdditionalFields->find($field_id); >- $deleted = $af->delete; >+ if ( !$af->is_system ) { >+ $deleted = $af->delete; >+ } > }; > push @messages, { > code => 'delete', >@@ -140,4 +144,4 @@ $template->param( > messages => \@messages, > ); > >-output_html_with_http_headers $input, $cookie, $template->output; >\ No newline at end of file >+output_html_with_http_headers $input, $cookie, $template->output; >-- >2.43.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 35625
:
160171
|
160172
|
160173
|
160174
|
160175
|
160176
|
173567
|
173568
|
173569
|
173570
|
173571
|
173573
|
173574
|
173575
|
173576
|
173577
|
173578