[Rt-commit] rt branch, 5.0/fix-slow-performance-for-custom-fields-with-many-values, created. rt-5.0.0-27-gf988cee942
Dianne Skoll
dianne at bestpractical.com
Wed Sep 30 10:09:24 EDT 2020
The branch, 5.0/fix-slow-performance-for-custom-fields-with-many-values has been created
at f988cee942be1185e0f2ec92bfc73eb3e9215f86 (commit)
- Log -----------------------------------------------------------------
commit f988cee942be1185e0f2ec92bfc73eb3e9215f86
Author: Dianne Skoll <dianne at bestpractical.com>
Date: Wed Sep 30 09:58:33 2020 -0400
Even if inline editing was disabled, the code was still fetching all custom field values for selection fields.
This commit turns that off.
diff --git a/share/html/Elements/CollectionAsTable/Row b/share/html/Elements/CollectionAsTable/Row
index aa1426fb92..6396b68b35 100644
--- a/share/html/Elements/CollectionAsTable/Row
+++ b/share/html/Elements/CollectionAsTable/Row
@@ -91,7 +91,11 @@ foreach my $column (@Format) {
my $class = $column->{class} ? $m->interp->apply_escapes($column->{class}, 'h') : 'collection-as-table';
my %attrs;
- foreach my $attr (qw(style align edit)) {
+ my @possible_attrs = qw(style align);
+ if ($InlineEdit && $record->isa('RT::Ticket') && $record->CurrentUserHasRight('ModifyTicket')) {
+ push(@possible_attrs, 'edit');
+ }
+ foreach my $attr (@possible_attrs) {
if ( defined $column->{ $attr } ) {
$attrs{ $attr } = $column->{ $attr };
next;
@@ -116,13 +120,6 @@ foreach my $column (@Format) {
);
}
- delete $attrs{edit} if !$InlineEdit;
-
- delete $attrs{edit} unless $record->isa('RT::Ticket');
-
- delete $attrs{edit} if $record->isa('RT::Ticket')
- && !$record->CurrentUserHasRight('ModifyTicket');
-
$attrs{colspan} = $column->{span};
$item += ($attrs{'colspan'} || 1);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list