diff --git a/classes/submission/reviewer/recommendation/ReviewerRecommendation.php b/classes/submission/reviewer/recommendation/ReviewerRecommendation.php index 0dca017df7c..49d3ae89c2c 100644 --- a/classes/submission/reviewer/recommendation/ReviewerRecommendation.php +++ b/classes/submission/reviewer/recommendation/ReviewerRecommendation.php @@ -41,6 +41,8 @@ class ReviewerRecommendation extends Model */ protected $guarded = [ 'recommendation_id', + 'recommendationId', + 'value', ]; /** @@ -122,26 +124,11 @@ public function getMultilingualProps(): array protected function value(): Attribute { return Attribute::make( - set: function (?int $value) { + set: function () { if ($this->getRawOriginal('value')) { return $this->getRawOriginal('value'); } - if ($value) { - $existingRecommendation = static::query() - ->withContextId($this->contextId) - ->where('value', $value) - ->exists(); - - if ($existingRecommendation) { - throw new Exception( - "Given recommendation value : {$value} already exist for given context" - ); - } - - return $value; - } - $lastRecommendationValue = static::query() ->withContextId($this->contextId) ->when(