Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsunnavy <sunnavy@bestpractical.com>2021-11-22 20:50:37 +0300
committersunnavy <sunnavy@bestpractical.com>2021-11-22 20:56:30 +0300
commit8d963c1214e3ae8dbdda90ba0bca32c46b989633 (patch)
tree7a0afc0d7e658bbc0cd68694cc1344d80e1e9180
parent1ad2a168b95037afd869d2f6ff71050b6d1ae991 (diff)
Add the missing validate_input call for REST2 ticket update5.0/rest2-validate-input-on-ticket-update
This is ported from RT-Extension-REST2 and was supposed to be included in df5092aa75, but got dropped probably because of conflicts.
-rw-r--r--lib/RT/REST2/Resource/Ticket.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/RT/REST2/Resource/Ticket.pm b/lib/RT/REST2/Resource/Ticket.pm
index 5caff4709f..631b15fc66 100644
--- a/lib/RT/REST2/Resource/Ticket.pm
+++ b/lib/RT/REST2/Resource/Ticket.pm
@@ -125,6 +125,13 @@ sub update_record {
my $self = shift;
my $data = shift;
+ my ($ok, $msg, $return_code) = $self->validate_input(Data => $data, Action => 'update');
+
+ # XXX TODO: refactor update_resource to accept return_code in response
+ if (!$ok) {
+ return (0, $msg);
+ }
+
my @results;
if ( my $action = $self->action ) {