[Rt-commit] rt branch, 4.4/default-cfv-dupes, repushed
Shawn Moore
shawn at bestpractical.com
Thu Nov 17 13:38:24 EST 2016
The branch 4.4/default-cfv-dupes was deleted and repushed:
was cd078037b3406c6f445405451bcf4831036d45da
now d4ea52ad789de098ec421b6c20f4265a3bb17ca5
1: cd07803 ! 1: d4ea52a Avoid using NamePrefix for CF fields on Defaults admin
@@ -20,10 +20,40 @@
less intrusive than opening up the JavaScript to handle Default-#-Value,
as we wouldn't want sync_grouped_custom_fields() to run on any false
positives. Additionally this is one fewer way that Default Values is
- different from other forms, reducing the likelihood of one-off problems
- like this.
+ different from other forms, reducing the likelihood of future one-off
+ problems like this.
Fixes: I#32441
+
+diff --git a/share/html/Admin/Assets/Catalogs/DefaultValues.html b/share/html/Admin/Assets/Catalogs/DefaultValues.html
+--- a/share/html/Admin/Assets/Catalogs/DefaultValues.html
++++ b/share/html/Admin/Assets/Catalogs/DefaultValues.html
+@@
+ $catalog->AssetCustomFields->LimitToDefaultValuesSupportedTypes
+ },
+ TitleBoxARGS => { title_class => "inverse" },
+- NamePrefix => 'Default-',
+ Object => RT::Asset->new($session{CurrentUser})
+ &>
+
+@@
+ }
+ }
+ elsif ( $ARGS{Update} ) {
+- for my $cf_id ( map { /^Default-(\d+)-/ ? $1 : () } keys %ARGS ) {
++ for my $arg (keys %ARGS) {
++ my ($cf_id) = $arg =~ /^Object-RT::Asset-\d*-CustomField(?::\w+)?-(\d+)-Values?$/;
++ next unless $cf_id;
+ my $cf = RT::CustomField->new($session{CurrentUser});
+ $cf->Load($cf_id);
+ if ( $cf->id && $cf->SupportDefaultValues ) {
+ my ($ret, $msg) = $cf->SetDefaultValues(
+ Object => $catalog,
+- Values => $ARGS{'Default-' . $cf->id . '-Value'} // $ARGS{'Default-' . $cf->id . '-Values'},
++ Values => $ARGS{$arg},
+ );
+ push @results, $msg;
+ }
diff --git a/share/html/Admin/Queues/DefaultValues.html b/share/html/Admin/Queues/DefaultValues.html
--- a/share/html/Admin/Queues/DefaultValues.html
More information about the rt-commit
mailing list