[Rt-commit] rt branch 5.0/improve-asset-webconfig-userassetextrainfo-and-defaultcatalog created. rt-5.0.2-62-g9d8ea691fb
BPS Git Server
git at git.bestpractical.com
Wed Feb 9 15:03:43 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/improve-asset-webconfig-userassetextrainfo-and-defaultcatalog has been created
at 9d8ea691fb950a1cfcd7b508e58a132819d98368 (commit)
- Log -----------------------------------------------------------------
commit 9d8ea691fb950a1cfcd7b508e58a132819d98368
Author: Brian Conry <bconry at bestpractical.com>
Date: Wed Feb 9 08:39:45 2022 -0600
Automatically dequote ExtraInfo options
The options UserAssetExtraInfo, UserSummaryExtraInfo,
GroupSummaryExtraInfo, and MoreAboutRequestorExtraInfo are strings that
are intended to contain a list of field names (optionally delimited by
commas) for their respective objects to display in specific places.
Examples for setting these are generally given in the context of setting
them in RT_SiteConfig, and so they include quotes around the string.
If an admin copies that example, including the quotes, and pastes it
into the web config UI the previous behavior was to preserve those
quotes as part of the string.
Due to how these option values are processed this doesn't generate any
errors or warnings, but it does cause the display to show no fields at
all rather than the fields intended.
diff --git a/share/html/Admin/Tools/EditConfig.html b/share/html/Admin/Tools/EditConfig.html
index bafaf8d405..50ff7a9223 100644
--- a/share/html/Admin/Tools/EditConfig.html
+++ b/share/html/Admin/Tools/EditConfig.html
@@ -95,6 +95,11 @@ if (delete $ARGS{Update}) {
my $val = $ARGS{$key};
$val = '' if $val eq '__empty_value__';
+
+ if ($key =~ /ExtraInfo$/ and $widget eq '/Widgets/Form/MultilineString' and $meta->{Type} eq 'SCALAR' ) {
+ $val =~ s/^(['"])([^'"]*)\1$/$2/;
+ }
+
my $prev = $ARGS{$key . '-Current'};
next if $val eq $prev;
commit c7a230b8006cf9038355b18e7dfe55be5a96b655
Author: Brian Conry <bconry at bestpractical.com>
Date: Tue Feb 8 15:39:22 2022 -0600
Allow DefualtCatalog to be unset in Web Interface
Previously it was listed as needing to be set, even though the default
is unset, so the selectbox for it in the Assets subsection of the System
Configuration page was created without a "(no value)" option. The
result of this is that any change made in that subsection would set the
DefaultCatalog to whichever catalog happened to be first in the list.
It also prevented it from processing a "Reset" as the handling of the
form data wouldn't accept having nothing selected.
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 45d66d2244..3bc4314874 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1960,8 +1960,10 @@ our %META;
DefaultCatalog => {
Widget => '/Widgets/Form/Select',
+ Overridable => 1,
WidgetArguments => {
Description => 'Default catalog', #loc
+ Default => 1, # allow user to unset it on EditConfig.html
Callback => sub {
my $ret = { Values => [], ValuesLabel => {} };
my $c = RT::Catalogs->new( $HTML::Mason::Commands::session{'CurrentUser'} );
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list