@@ -, +, @@ update DB process --- .../mysql/atomicupdate/bug_4944_OpacNoItemTypeImages.perl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/installer/data/mysql/atomicupdate/bug_4944_OpacNoItemTypeImages.perl +++ a/installer/data/mysql/atomicupdate/bug_4944_OpacNoItemTypeImages.perl @@ -1,9 +1,11 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - my $noItemTypeImages = C4::Context->preference('noItemTypeImages'); - $dbh->do( "INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) - VALUES('OpacNoItemTypeImages',$noItemTypeImages,NULL,'If ON, disables itemtype images in the OPAC','YesNo')" ); + $dbh->do( q| + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + SELECT 'OpacNoItemTypeImages', value, NULL, 'If ON, disables itemtype images in the OPAC','YesNo' + FROM (SELECT value FROM systempreferences WHERE variable="NoItemTypeImages") tmp + | ); $dbh->do( "UPDATE systempreferences SET explanation = 'If ON, disables itemtype images in the staff interface' WHERE variable = 'noItemTypeImages' "); --