Skip Menu |

This queue is for tickets about the RT-Extension-CustomFieldsOnUpdate CPAN distribution.

Report information
The Basics
Id: 100177
Status: resolved
Priority: 0/
Queue: RT-Extension-CustomFieldsOnUpdate

People
Owner: cpan [...] jibsheet.com
Requestors: aballester [...] fundaciobit.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.01



Subject: Mandatory on CF don't work
Date: Fri, 07 Nov 2014 09:37:00 +0100
To: "'bug-RT-Extension-CustomFieldsOnUpdate [...] rt.cpan.org'" <bug-RT-Extension-CustomFieldsOnUpdate [...] rt.cpan.org>
From: Ana Ballester <aballester [...] fundaciobit.org>
Thanks for RT::Extension::CustomFieldsOnUpdate too! I hope this extension will be integrated in future versions of RT, I feel it indispensable. I work with 4.2.5 version of RT and CF’s groupings. In previous versions of RT “On Comment” or “On Response” checked Mandatory CF and didn’t allow save changes until I set a value in CF. But, in the actual version (4.2.5) “On Comment” or “On Response” it allows save changes although the Mandatory CF are not filled up. Can you help me? There are any code that I can change? I revised BeforeUpdate an update the code based on new code in 4.2.5 version without success. Thanks in advanced!

Message body is not shown because it is too large.

In RT 4.2 Object must be passed to ValidateCustomFields (NamePrefix is no longer used). Attached patch should be ok, thought untested on, 4.0 (jsut need to check taht Object isn't used).
Subject: 0001-Fix-CF-validation-on-RT-4.2.x.patch
From a7eaf58ffb9de3be1ea0e758229a32dbe0a25b57 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@home-dn.net> Date: Tue, 27 Jan 2015 16:25:51 +0100 Subject: [PATCH] Fix CF validation on RT 4.2.x RT 4.2.x doesn't use NamePrefix arg, but Object arg. Leaving NamePrefix won't harm and keep RT < 4.2 compatibility. --- .../Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rt/local/plugins/RT-Extension-CustomFieldsOnUpdate/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate b/rt/local/plugins/RT-Extension-CustomFieldsOnUpdate/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate index 6370533..275a1f1 100644 --- a/rt/local/plugins/RT-Extension-CustomFieldsOnUpdate/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate +++ b/rt/local/plugins/RT-Extension-CustomFieldsOnUpdate/html/Callbacks/CustomFieldsOnUpdate/Ticket/Update.html/BeforeUpdate @@ -12,6 +12,7 @@ my $ValidCFs = $m->comp( '/Elements/ValidateCustomFields', CustomFields => $CFs, NamePrefix => "Object-RT::Ticket-". $TicketObj->id ."-CustomField-", + Object => $TicketObj, ARGSRef => $ARGSRef ); unless ( $ValidCFs ) { @@ -21,4 +22,4 @@ unless ( $ValidCFs ) { push @$results, loc($CF->Name) . ': ' . $msg; } } -</%INIT> \ No newline at end of file +</%INIT> -- 2.1.4
Subject: Re: [rt.cpan.org #100177] Mandatory on CF don't work
Date: Tue, 27 Jan 2015 15:53:24 -0500
To: Emmanuel Lacour via RT <bug-RT-Extension-CustomFieldsOnUpdate [...] rt.cpan.org>
From: Kevin Falcone <falcone [...] bestpractical.com>
On Tue, Jan 27, 2015 at 10:28:01AM -0500, Emmanuel Lacour via RT wrote: Show quoted text
> In RT 4.2 Object must be passed to ValidateCustomFields (NamePrefix is no longer used). > > Attached patch should be ok, thought untested on, 4.0 (jsut need to check taht Object isn't used).
Seems to work fine locally on 4.0, I'll ship a new version to CPAN. Thanks for the patch. -kevin
1.01 - containing this patch - was shipped to CPAN last night.