Lines 52-61
if( !$biblio ) {
Link Here
|
52 |
} elsif( $reviewid ) { # edit existing one, check on creator |
52 |
} elsif( $reviewid ) { # edit existing one, check on creator |
53 |
$savedreview = Koha::Reviews->search({ reviewid => $reviewid, borrowernumber => $borrowernumber })->next; |
53 |
$savedreview = Koha::Reviews->search({ reviewid => $reviewid, borrowernumber => $borrowernumber })->next; |
54 |
push @errors, { unauthorized => 1 } if !$savedreview; |
54 |
push @errors, { unauthorized => 1 } if !$savedreview; |
55 |
} else { # this check prevents adding multiple comments |
55 |
} else { # this check prevents adding multiple comments |
56 |
# FIXME biblionumber, borrowernumber should be a unique key of reviews |
56 |
# FIXME biblionumber, borrowernumber should be a unique key of reviews |
57 |
$savedreview = Koha::Reviews->search({ biblionumber => $biblionumber, borrowernumber => $borrowernumber })->next; |
57 |
$savedreview = Koha::Reviews->search( { biblionumber => $biblionumber, borrowernumber => $borrowernumber } )->next; |
58 |
$review = $savedreview? $savedreview->review: $review; |
58 |
$review = $savedreview ? $savedreview->review : $review; |
59 |
} |
59 |
} |
60 |
|
60 |
|
61 |
if( $op =~ /^cud-/ && !@errors && defined $review ) { |
61 |
if( $op =~ /^cud-/ && !@errors && defined $review ) { |
62 |
- |
|
|