Bugzilla – Attachment 34478 Details for
Bug 13465
Fields controlled by authorized values cannot be unset (Lost, damaged, not for loan status, ...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13465: Fix silly regex on generating default values hash
Bug-13465-Fix-silly-regex-on-generating-default-va.patch (text/plain), 1.50 KB, created by
Jonathan Druart
on 2014-12-17 09:51:00 UTC
(
hide
)
Description:
Bug 13465: Fix silly regex on generating default values hash
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-12-17 09:51:00 UTC
Size:
1.50 KB
patch
obsolete
>From 3ccb1674839d77db2358bc4042faa18429d80477 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 17 Dec 2014 10:43:34 +0100 >Subject: [PATCH] Bug 13465: Fix silly regex on generating default values hash > >This is introduced by Bug 12874. > >Without this patch, it's not possible to clear (set to an empty string) >an item field. >This appended for field linked to an AV list but even if it's not. > >The regex tried to prefix 'my_field' with 'items.' to have >'items.my_field'. It wanted to take care of the case where the prefix >already exists (Actually only 1: 'items.cn_source'). >The regex is changed to: "add the prefix only if the string does not >contain a dot". > >Test plan: >- edit an item, set a status that is controlled by an authorized value >examples tested: damaged, not for loan >- check the status saved correctly >- edit the item again, reset the status to empty >- check the status saved correctly >--- > C4/Items.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index e63ef1b..77dda74 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -482,7 +482,7 @@ sub _build_default_values_for_mod_marc { > withdrawn => 0, > }; > while ( my ( $field, $default_value ) = each %$default_values ) { >- $field =~ s|[^\.]*\.?(.*)|items.$1|; >+ $field =~ s|^([^\.]+)$|items.$1|; > $default_values_for_mod_from_marc{$frameworkcode}{$field} = > $default_value > if C4::Koha::IsKohaFieldLinked( >-- >2.1.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 13465
:
34478
|
34508
|
34511
|
34519