[Rt-commit] rt branch 5.0/fix-5-0-4-custom-roles-upgrade-bug created. rt-5.0.4-115-gb11c355150

BPS Git Server git at git.bestpractical.com
Thu Aug 24 17:41:39 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/fix-5-0-4-custom-roles-upgrade-bug has been created
        at  b11c355150369797600448cf292351f95a205f6f (commit)

- Log -----------------------------------------------------------------
commit b11c355150369797600448cf292351f95a205f6f
Author: Brad Embree <brad at bestpractical.com>
Date:   Thu Aug 24 10:37:45 2023 -0700

    Add default value for calls to LookupType
    
    If upgrading from 4.4.1 or previous and the database has a custom role
    the 4.4.2 upgrade step fails as the 5.0.4 code expects the LookupType
    column to exist in the database.
    
    Adding a default value for calls to LookupType ensures if there is no
    result the code defaults to the only possible value for older databases.

diff --git a/lib/RT/Record/Role/LookupType.pm b/lib/RT/Record/Role/LookupType.pm
index 3f477f9bb1..2db9d2b697 100644
--- a/lib/RT/Record/Role/LookupType.pm
+++ b/lib/RT/Record/Role/LookupType.pm
@@ -173,7 +173,7 @@ Returns a localized description of the LookupType of this record
 
 sub FriendlyLookupType {
     my $self = shift;
-    my $lookup = shift || $self->LookupType;
+    my $lookup = shift || ( $self->LookupType || 'RT::Queue-RT::Ticket' );
 
     my $class = blessed($self) || $self;
 
@@ -208,7 +208,7 @@ object.
 
 sub RecordClassFromLookupType {
     my $self = shift;
-    my $type = shift || $self->LookupType;
+    my $type = shift || ( $self->LookupType || 'RT::Queue-RT::Ticket');
     my ($class) = ($type =~ /^([^-]+)/);
     unless ( $class ) {
         if (blessed($self) and $self->LookupType eq $type) {
@@ -237,7 +237,7 @@ object.
 
 sub ObjectTypeFromLookupType {
     my $self = shift;
-    my $type = shift || $self->LookupType;
+    my $type = shift || ( $self->LookupType || 'RT::Queue-RT::Ticket' );
     my ($class) = ($type =~ /([^-]+)$/);
     unless ( $class ) {
         if (blessed($self) and $self->LookupType eq $type) {

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list