Bugzilla – Attachment 23196 Details for
Bug 11313
empty value in mandatory combobox in record edition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11313 - empty value in mandatory combobox in record edition
0001-Bug-11313-empty-value-in-mandatory-combobox-in-recor.patch (text/plain), 3.86 KB, created by
Fridolin Somers
on 2013-11-27 16:03:58 UTC
(
hide
)
Description:
Bug 11313 - empty value in mandatory combobox in record edition
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-11-27 16:03:58 UTC
Size:
3.86 KB
patch
obsolete
>From 54206dcab177ea787835302965df12be0f4027cb Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 27 Nov 2013 16:40:09 +0100 >Subject: [PATCH] Bug 11313 - empty value in mandatory combobox in record > edition > >In biblio (or authority) record edition or creation, >Bug 3727 added an empty value to combobox for subfield using itemtype authorized values, which is mandatory and does not have a default value. This to avoid selecting arbitrarily the first value of combo. > >This patch extends this behavior to normal authorized values like CCODE, COUNTRY ... >Also, when record already exists and has a defined value for the subfield this value will be selected in combobox so there is no need for an empty value. > >Test plan : >- In a biblio framework, set a subfield mandatory and using itemtypes authorised values >- Set a default value for this subfield >- Create a new record with the framework >=> You see the subfield with a combobox, the first empty value is selected >- Go to biblio framework and set a default value for the subfield >- Create a new record with the framework >=> You see the subfield with a combobox, the default value is selected and there is no empty value >- Select an other value and save the record >- Edit this record >=> You see the subfield with a combobox, the saved value is selected and there is no empty value > >Perform same tests with a normal authorized values categorie (instead of itemtypes). >Perform same tests with with authority creation/edition >Perform same tests with a normal authorized values categorie and authority creation/edition >--- > authorities/authorities.pl | 6 ++++-- > cataloguing/addbiblio.pl | 6 ++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index bb527f6..de8bbf8 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -92,7 +92,8 @@ sub build_authorized_values_list { > "select itemtype,description from itemtypes order by description"); > $sth->execute; > push @authorised_values, "" >- unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >+ unless ( $tagslib->{$tag}->{$subfield}->{mandatory} >+ && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); > > my $itemtype; > >@@ -109,7 +110,8 @@ sub build_authorized_values_list { > $tagslib->{$tag}->{$subfield}->{authorised_value} ); > > push @authorised_values, "" >- unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >+ unless ( $tagslib->{$tag}->{$subfield}->{mandatory} >+ && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); > > while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { > push @authorised_values, $value; >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 5069af9..3a2e2be 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -191,7 +191,8 @@ sub build_authorized_values_list { > "select itemtype,description from itemtypes order by description"); > $sth->execute; > push @authorised_values, "" >- unless ( $tagslib->{$tag}->{$subfield}->{defaultvalue} and $tagslib->{$tag}->{$subfield}->{mandatory} ); >+ unless ( $tagslib->{$tag}->{$subfield}->{mandatory} >+ && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); > > my $itemtype; > >@@ -228,7 +229,8 @@ sub build_authorized_values_list { > ); > > push @authorised_values, "" >- unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >+ unless ( $tagslib->{$tag}->{$subfield}->{mandatory} >+ && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); > > while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { > push @authorised_values, $value; >-- >1.8.3.2 >
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 11313
:
23196
|
24560
|
24590