[Bps-public-commit] RT-Extension-MandatoryOnTransition branch master updated. 0.22-1-geb1094a
BPS Git Server
git at git.bestpractical.com
Fri Jul 29 21:02:35 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "RT-Extension-MandatoryOnTransition".
The branch, master has been updated
via eb1094af9f1ff61e579eb77500a83f1536afbc7e (commit)
from 73a1b3d1a5edf7485a5be03098cc173d47e85fdd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit eb1094af9f1ff61e579eb77500a83f1536afbc7e
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date: Mon Jun 7 16:08:41 2021 +0200
Add support for CF type Binary/Image
diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm
index 41d9357..25a1f6b 100644
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@ -840,7 +840,7 @@ sub CheckMandatoryFields {
$submitted = $submitted ? $submitted->{(sort keys %$submitted)[0]} : {};
my @values;
- for my $argtype (qw/Values Value/) {
+ for my $argtype (qw/Values Value Upload/) {
next if @values;
@values = HTML::Mason::Commands::_NormalizeObjectCustomFieldValue(
CustomField => $cf,
@@ -852,7 +852,12 @@ sub CheckMandatoryFields {
($value) = @values;
}
else {
- my $arg = "Object-RT::Ticket-".$TicketId."-CustomField-".$cf->Id."-Value";
+ my $arg;
+ if ( $cf->Type =~ m/^(Binary|Image)$/ ) {
+ $arg = "Object-RT::Ticket-".$TicketId."-CustomField-".$cf->Id."-Upload";
+ } else {
+ $arg = "Object-RT::Ticket-".$TicketId."-CustomField-".$cf->Id."-Value";
+ }
$value = ($ARGSRef->{"${arg}s-Magic"} and exists $ARGSRef->{"${arg}s"}) ? $ARGSRef->{$arg . "s"} : $ARGSRef->{$arg};
($value) = grep length, map {
s/\r+\n/\n/g;
-----------------------------------------------------------------------
Summary of changes:
lib/RT/Extension/MandatoryOnTransition.pm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
hooks/post-receive
--
RT-Extension-MandatoryOnTransition
More information about the Bps-public-commit
mailing list