Test Plan:
1) Create a new serial with a default location, call number, and library
( the library will need to be any but the one you are logged in as )
2) Click the "Recieve" button for this serial
3) Click "Click to add item"
4) Note those values are not populated
5) Apply the patch
6) Reload the page
7) Click "Click to add item"
8) Note those values are now populated
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass!
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This seems to restore the former behaviour.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
&& $defaultvalues
&& $defaultvalues->{'callnumber'} ) {
if( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ){
&& $defaultvalues
&& $defaultvalues->{'callnumber'} ) {
if( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ){
+ # if the item record exists, only use default value if the item has no callnumber
+ $defaultvalue = $defaultvalues->{callnumber};
+ } elsif ( !$itemrecord and $defaultvalues ) {
+ # if the item record *doesn't* exists, always use the default value
$defaultvalue = $defaultvalues->{callnumber};
}
}
$defaultvalue = $defaultvalues->{callnumber};
}
}
&& $defaultvalues->{'location'} ) {
if ( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ) {
&& $defaultvalues->{'location'} ) {
if ( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ) {
+ # if the item record exists, only use default value if the item has no locationr
+ $defaultvalue = $defaultvalues->{location};
+ } elsif ( !$itemrecord and $defaultvalues ) {
+ # if the item record *doesn't* exists, always use the default value
$defaultvalue = $defaultvalues->{location};
}
}
$defaultvalue = $defaultvalues->{location};
}
}
$authorised_lib{$branchcode} = $branchname;
}
}
$authorised_lib{$branchcode} = $branchname;
}
}
- $defaultvalue = C4::Context->userenv->{branch};
+ $defaultvalue = $defaultvalues->{branchcode} || C4::Context->userenv->{branch};
#----- itemtypes
} elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
#----- itemtypes
} elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
$authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
}
$authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
}
+ $defaultvalue = $default_source;
+
#---- "true" authorised value
} else {
$authorised_values_sth->execute(
#---- "true" authorised value
} else {
$authorised_values_sth->execute(