Skip to content

Commit

Permalink
Fixed the objects creation with rolf tags and saving of the current c…
Browse files Browse the repository at this point in the history
…ontroll on the op risks table.
  • Loading branch information
ruslanbaidan committed Sep 27, 2024
1 parent 7a0940e commit 16ad8ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/ObjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function create(array $data, bool $saveInDb = true): Entity\MonarcObject
if (!empty($data['category'])) {
$this->validateAndSetCategory($monarcObject, $data);
}
if (!empty($data['rolfTag']) && !$asset->isPrimary()) {
if (!empty($data['rolfTag']) && $asset->isPrimary()) {
/** @var Entity\RolfTag $rolfTag */
$rolfTag = $this->rolfTagTable->findById((int)$data['rolfTag']);
$monarcObject->setRolfTag($rolfTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Monarc\Core\Validator\InputValidator\InstanceRiskOp;

use Laminas\Filter\StringTrim;
use Laminas\Filter\ToInt;
use Laminas\Validator\InArray;
use Monarc\Core\Entity\InstanceRiskOpSuperClass;
Expand All @@ -17,6 +18,16 @@ class UpdateInstanceRiskOpDataInputValidator extends AbstractInputValidator
protected function getRules(): array
{
return [
[
'name' => 'comment',
'required' => false,
'filters' => [
[
'name' => StringTrim::class,
],
],
'validators' => [],
],
[
'name' => 'netProb',
'required' => false,
Expand Down

0 comments on commit 16ad8ae

Please sign in to comment.