From b46754d842bc6a03ca3051307e4f32f0892b733f Mon Sep 17 00:00:00 2001 From: Aleisha Date: Tue, 21 Jul 2015 18:38:58 +0000 Subject: [PATCH] Bug 14553: Silencing warn triggered when clearing item rating on OPAC MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1) Go to any item and clear the star rating (don't have to set a rating first) 2) Notice the warn 3) Apply patch and reload page 4) Clear star rating 5) Notice no warn 6) Click a star to add a rating 7) Make sure your rating, the average rating and amount of votes are all correct 8) Could be beneficial to log in as another user and try to add a rating on the same item from their account. Check the average rating is cacalculated and amount of votes increases 9) Confirm still no warns Signed-off-by: Frederic Demians Can see the warning in logs, and its disappearance with this patch. Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 94c5f8d5f06b588da0903c9607349adbf16344be) Signed-off-by: Frédéric Demians (cherry picked from commit 0a325ab7ba740b69819d89bb1d6de18015289cae) Signed-off-by: Liz Rea --- opac/opac-ratings-ajax.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl index b1c3a6de0c..55b7f5814a 100755 --- a/opac/opac-ratings-ajax.pl +++ b/opac/opac-ratings-ajax.pl @@ -67,10 +67,9 @@ else { } my $rating; +$rating_value //= ''; -undef $rating_value if $rating_value eq ''; - -if ( !$rating_value ) { +if ( $rating_value eq '' ) { #### delete $rating = DelRating( $biblionumber, $loggedinuser ); } -- 2.39.5