[Rt-commit] rtir branch, 5.0/use-core-custom-field-default-values, repushed
Craig Kaiser
craig at bestpractical.com
Wed Jun 3 17:34:01 EDT 2020
The branch 5.0/use-core-custom-field-default-values was deleted and repushed:
was ea2fe03af04e45635166df073fdce19bc2b896e7
now 5c3b9cc3a5335aa1038bc943b9471dc9bc6e5ced
1: fcd26e9b ! 1: 806d4cb1 Use core default values instead of RTIR_CustomFieldsDefaults config
@@ -35,14 +35,13 @@
--- /dev/null
+++ b/etc/upgrade/4.9.1/content
@@
++use strict;
++use warnings;
++
+our @Final = sub {
+ my $custom_field = RT::CustomField->new( RT->SystemUser );
+
+ my $custom_field_defaults = RT->Config->Get('RTIR_CustomFieldsDefaults') || ();
-+ unless ( scalar keys %{$custom_field} ) {
-+ RT->Logger->error( "To set custom field defaults the %RTIR_CustomFieldsDefaults must be present, if there is a configuration for this value that was removed re-enable it and re-run this script." );
-+ die;
-+ }
+
+ foreach my $cf_name ( keys %{$custom_field_defaults} ) {
+ next if $cf_name eq 'Resolution';
@@ -52,7 +51,7 @@
+ RT->Logger->error( "Could not load custom field '$cf_name' : $msg" );
+ next;
+ }
-+ ($ret, $msg) = $custom_field->SetDefaultValues( Values => $custom_field_defaults->{$cf_name} );
++ ($ret, $msg) = $custom_field->SetDefaultValues( Values => $custom_field_defaults->{$cf_name} );
+ if ( $ret ) {
+ RT->Logger->debug( "Set default value for $cf_name to $custom_field_defaults->{$cf_name}" );
+ }
@@ -60,7 +59,6 @@
+ RT->Logger->error( "Could not set default value for $cf_name custom field: $msg" );
+ }
+ }
-+ RT->Logger->info( "Custom field defaults are now handled in the web UI on the custom field admin page, only Resolution needs to be set in \%RTIR_CustomFieldsDefaults." );
+};
diff --git a/html/RTIR/Elements/EditCustomFields b/html/RTIR/Elements/EditCustomFields
2: ea2fe03a = 2: 5c3b9cc3 Update tests to use core default CF values feature
More information about the rt-commit
mailing list