[Rt-commit] rt branch, 5.0/fix-saved-search-component, created. rt-5.0.0-2-gc038c6d4b6

Aaron Trevena ast at bestpractical.com
Tue Aug 18 08:45:10 EDT 2020


The branch, 5.0/fix-saved-search-component has been created
        at  c038c6d4b676da3964e370c3c575c98eea3fbc17 (commit)

- Log -----------------------------------------------------------------
commit c038c6d4b676da3964e370c3c575c98eea3fbc17
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.
    
    Fixes I#36605: Broken SavedSearches Component

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