Skip to content

Commit

Permalink
mvc: model silence spurious validation message when explitly asked to…
Browse files Browse the repository at this point in the history
… ignore validations. (#7470)
  • Loading branch information
AdSchellevis committed May 20, 2024
1 parent 9b495c7 commit 611ee6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ public function serializeToConfig($validateFullModel = false, $disable_validatio
$exception_msg_part .= sprintf("{%s}", $field_value);
}
$exception_msg .= "$exception_msg_part\n";
// always log validation errors
$logger->error($exception_msg_part);
if (!$disable_validation) {
$logger->error($exception_msg_part);
}
}
if (!$disable_validation) {
throw new ValidationException($exception_msg);
Expand Down

0 comments on commit 611ee6a

Please sign in to comment.