[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0-70-gf74fc55996

? sunnavy sunnavy at bestpractical.com
Tue Nov 3 16:31:16 EST 2020


The branch, 5.0-trunk has been updated
       via  f74fc55996fb7ef3bf71b39618c84bda949260c7 (commit)
       via  c37a4597ddd0db178ee97f12de7dd3b934115fb8 (commit)
      from  fbaa86cf248706b719a01ad369309e2b1f764979 (commit)

Summary of changes:
 lib/RT/Dashboards.pm     | 4 ----
 lib/RT/SharedSetting.pm  | 8 ++++++++
 lib/RT/SharedSettings.pm | 8 ++++++++
 3 files changed, 16 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit c37a4597ddd0db178ee97f12de7dd3b934115fb8
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Thu Aug 6 08:34:04 2020 +0100

    Add ColumnMapClassName method to RT::SharedSetting
    
    Addresses a bug causing a fatal error in the SavedSearch dashboard component:
    Can't locate object method "ColumnMapClassName" via package "RT::SavedSearch"
    
    Commit f6cdaf8c11f252fd3e31ee85c8f8db7ad4fbbfe8 added support for multiple
    types of RT::Record to the querybuilder in addition to tickets, using the
    ColumnMapClassName method to provide the classname for ColumnMap to load the
    correct list display. SharedSetting sub-classes aren't simple records and so
    didn't have this method resulting in an error when used in dashboard
    component searches.
    
    Adding the ColumnMapClassName method to the RT::SharedSetting base class
    allows objects inheriting from it to work in the same way as RT::Record based
    objects, and makes any method providing a hardcoded classname un-necessary.
    
    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..028b4ace1d 100644
--- a/lib/RT/SharedSetting.pm
+++ b/lib/RT/SharedSetting.pm
@@ -385,6 +385,14 @@ sub CurrentUserCanCreate { 1 }
 sub CurrentUserCanModify { 1 }
 sub CurrentUserCanDelete { 1 }
 
+=head2 ColumnMapClassName
+
+Equivalent to L<RT::Record/ColumnMapClassName>
+
+=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..413704cea3 100644
--- a/lib/RT/SharedSettings.pm
+++ b/lib/RT/SharedSettings.pm
@@ -138,6 +138,14 @@ sub GotoPage {
     $self->{idx} = shift;
 }
 
+=head2 ColumnMapClassName
+
+Equivalent to L<RT::SearchBuilder/ColumnMapClassName>
+
+=cut
+
+sub ColumnMapClassName { return shift->RecordClass->ColumnMapClassName }
+
 ### Internal methods
 
 # _GetObject: helper routine to load the correct object whose parameters

commit f74fc55996fb7ef3bf71b39618c84bda949260c7
Merge: fbaa86cf24 c37a4597dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Nov 4 05:20:57 2020 +0800

    Merge branch '5.0/fix-saved-search-component' into 5.0-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list