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

Aaron Trevena ast at bestpractical.com
Thu Aug 20 05:38:00 EDT 2020


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

- Log -----------------------------------------------------------------
commit 186d637ebc601de19b42d889dfb2e85b6a260632
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 5.0 commit f6cdaf8c11f252fd3e31ee85c8f8db7ad4fbbfe8
    that causes 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