From b8919ec56d3568fe946957a40301903db99272dc Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 15 Feb 2021 04:02:25 -0700 Subject: [PATCH] Girocco/Project.pm: add optional silent flag to cgi_fill In order to add more messages before calling err_check, it's important that cgi_fill not prematurely dump out the messages. If the optional second parameter is true, the messages will be suppressed, but the return value will still be the same. Signed-off-by: Kyle J. McKay --- Girocco/Project.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index da0c523..20b8ac4 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -678,7 +678,7 @@ sub load { # in @Girocco::Config::project_fields are totally ignored! sub cgi_fill { my $self = shift; - my ($gcgi) = @_; + my ($gcgi, $silent) = @_; my $cgi = $gcgi->cgi; my %allowedfields = map({$_ => 1} @Girocco::Config::project_fields); my $field_enabled = sub { @@ -847,7 +847,7 @@ sub cgi_fill { $self->{statusupdates} = $val ? 1 : 0; } - not $gcgi->err_check; + $silent ? $gcgi->ok : !$gcgi->err_check; } sub form_defaults { -- 2.11.4.GIT