--- /dev/null
+my $dbh = C4::Context->dbh;
+my ( $count_imageurl ) = $dbh->selectrow_array(q|
+ SELECT COUNT(*)
+ FROM authorised_values
+ WHERE imageurl IS NOT NULL
+ AND imageurl <> ""
+|);
+unless ( $count_imageurl ) {
+ if ( C4::Context->preference('AuthorisedValueImages')
+ or C4::Context->preference('StaffAuthorisedValueImages') ) {
+ $dbh->do(q|
+ UPDATE systempreferences
+ SET value=0
+ WHERE variable="AuthorisedValueImages"
+ or variable="StaffAuthorisedValueImages"
+ |);
+ warn "The system preferences AuthorisedValueImages and StaffAuthorisedValueImages have been turned off\n";
+ warn "authorised_values.imageurl is not populated, that means you are not using this feature\n"
+ }
+} else {
+ warn "At least one authorised value has an icon defined (imageurl)\n";
+ warn "The system preference AuthorisedValueImages or StaffAuthorisedValueImages could be turned off if you are not aware of this feature\n";
+}
('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'),
('SpineLabelFormat','<itemcallnumber><copynumber>','30|10','This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.','Textarea'),
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
-('StaffAuthorisedValueImages','1',NULL,'','YesNo'),
+('StaffAuthorisedValueImages','0',NULL,'','YesNo'),
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
$dat->{'count'} = scalar(@items);
-my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
+my $biblio_authorised_value_images = C4::Context->preference('AuthorisedValueImages')
+ ? C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) )
+ : [];
my (%item_reserves, %priority);
my ($show_holds_count, $show_priority);