[Rt-commit] rt branch, 5.0/fix-saved-search-component, created. rt-5.0.0-2-g50be5a52fe
Aaron Trevena
ast at bestpractical.com
Wed Aug 19 15:56:19 EDT 2020
The branch, 5.0/fix-saved-search-component has been created
at 50be5a52fed57e7b9367d718344f6a895b8b0ebe (commit)
- Log -----------------------------------------------------------------
commit 50be5a52fed57e7b9367d718344f6a895b8b0ebe
Author: Aaron Trevena <ast at bestpractical.com>
Date: Thu Aug 6 08:34:04 2020 +0100
Add ColumnMapClassName method to RT::SharedSetting/ShareSettings
Allow SavedSearch and other SharedSetting Classes with ColumnMaps
to be usable in CollectionList. Updated RT::Dashboards to use inherited
new method.
Addresses a bug introduced in RT5 causing a fatal error in the SavedSearch component:
Can't locate object method "ColumnMapClassName" via package "RT::SavedSearch"
Fixes: I#36605
diff --git a/lib/RT/Dashboards.pm b/lib/RT/Dashboards.pm
index 23f2fc5aa3..2fd8628889 100644
--- a/lib/RT/Dashboards.pm
+++ b/lib/RT/Dashboards.pm
@@ -120,10 +120,6 @@ sub SortDashboards {
return;
}
-sub ColumnMapClassName {
- return 'RT__Dashboard';
-}
-
RT::Base->_ImportOverlays();
1;
diff --git a/lib/RT/SharedSetting.pm b/lib/RT/SharedSetting.pm
index f66912876b..407957e9bd 100644
--- a/lib/RT/SharedSetting.pm
+++ b/lib/RT/SharedSetting.pm
@@ -385,6 +385,18 @@ sub CurrentUserCanCreate { 1 }
sub CurrentUserCanModify { 1 }
sub CurrentUserCanDelete { 1 }
+=head2 ColumnMapClassName
+
+ColumnMap needs a massaged collection class name to load the correct list
+display. Equivalent to L<RT::SearchBuilder/ColumnMapClassName>, but provided
+for a record instead of a collection.
+
+Returns a string. May be called as a package method.
+
+=cut
+
+sub ColumnMapClassName { return RT::Record::ColumnMapClassName(shift) }
+
### Internal methods
# _GetObject: helper routine to load the correct object whose parameters
diff --git a/lib/RT/SharedSettings.pm b/lib/RT/SharedSettings.pm
index 79e42bd70d..266fe235ea 100644
--- a/lib/RT/SharedSettings.pm
+++ b/lib/RT/SharedSettings.pm
@@ -138,6 +138,21 @@ sub GotoPage {
$self->{idx} = shift;
}
+
+
+=head2 ColumnMapClassName
+
+ColumnMap needs a massaged collection class name to load the correct list
+display. Equivalent to L<RT::SearchBuilder/ColumnMapClassName>, but provided
+for a record instead of a collection.
+
+Returns a string. May be called as a package method.
+
+=cut
+
+sub ColumnMapClassName { return shift->RecordClass->ColumnMapClassName }
+
+
### Internal methods
# _GetObject: helper routine to load the correct object whose parameters
-----------------------------------------------------------------------
More information about the rt-commit
mailing list