Bug 9117: Add imageurl to the list of parameters of AddAuthorisedValue
and add unit test in t/db_dependant/Koha.t Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
parent
d00f21833a
commit
8eae0c2a67
10
C4/Koha.pm
10
C4/Koha.pm
|
|
@ -1229,22 +1229,22 @@ sub GetKohaAuthorisedValueLib {
|
|||
|
||||
=head2 AddAuthorisedValue
|
||||
|
||||
AddAuthorisedValue($category, $authorised_value, $lib, $lib_opac);
|
||||
AddAuthorisedValue($category, $authorised_value, $lib, $lib_opac, $imageurl);
|
||||
|
||||
Create a new authorised value.
|
||||
|
||||
=cut
|
||||
|
||||
sub AddAuthorisedValue {
|
||||
my ($category, $authorised_value, $lib, $lib_opac) = @_;
|
||||
my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_;
|
||||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $query = qq{
|
||||
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac)
|
||||
VALUES (?,?,?,?)
|
||||
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl)
|
||||
VALUES (?,?,?,?,?)
|
||||
};
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($category, $authorised_value, $lib, $lib_opac);
|
||||
$sth->execute($category, $authorised_value, $lib, $lib_opac, $imageurl);
|
||||
}
|
||||
|
||||
=head2 display_marc_indicators
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ subtest 'Authorized Values Tests' => sub {
|
|||
|
||||
|
||||
# Insert an entry into authorised_value table
|
||||
my $query = "INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) VALUES (?,?,?,?,?);";
|
||||
my $sth = $dbh->prepare($query);
|
||||
my $insert_success = $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
|
||||
my $insert_success = AddAuthorisedValue($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
|
||||
ok($insert_success, "Insert data in database");
|
||||
|
||||
|
||||
|
|
@ -57,8 +55,8 @@ subtest 'Authorized Values Tests' => sub {
|
|||
|
||||
# Clean up
|
||||
if($insert_success){
|
||||
$query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;";
|
||||
$sth = $dbh->prepare($query);
|
||||
my $query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;";
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue