chakatodd/rt-extension-assettracker — Issue #24: Custom Date fields get deleted on update (when they are not the focus of the update)
Author: dwc4195
Created: 2011-12-21 20:56:16+00:00
State: open

any time I would update custom fields in the asset tracker, any custom dates would get purged. Don't think this was by design, but it doesn't match the RT function.

Anyway, I tracked down how to fix it for me. I have attached the diff below.
*********************************************************************

*** Web.pm 2011-10-03 16:56:30.000000000 -0500
--- /opt/rt4/local/plugins/RTx-AssetTracker/lib/RTx/AssetTracker/Interface/Web.pm 2011-12-21 14:54:02.549951274 -0600
***************
*** 885,890 ****
--- 885,894 ----
$values_hash{ $val } = 1 if $val;
}

+ #20111221 - added from RT::Web.pm routine to fix dates disappearing
+ # For Date Cfs, @values is empty when there is no changes (no datas in form input)
+ return @results if ( $cf->Type =~ /^Date(?:Time)?$/ && ! @values );
+
$cf_values->RedoSearch;
while ( my $cf_value = $cf_values->Next ) {
next if $values_hash{ $cf_value->id };