Skip to content

LDAP: Fix get_value on undefined value for external_entry

Alexej Kolbin requested to merge external-ldap-fix into main

Fix: Can't call method "get_value" on an undefined value at /etc/request-tracker4/RT_SiteConfig.d/70-ldap.pm line 54. (/usr/share/request-tracker4/lib/RT.pm:408) I do not know, in which cases the external_entry is specified by RT and in which not. The logs show this error occurred at least since 01.07.2024

Taken from the documentation: https://github.com/bestpractical/rt/blob/rt-4.4.6/lib/RT/Authen/ExternalAuth.pm#L261 "The subroutine is called in 2 modes: when called with external_entry specified, it should return value or list of values, otherwise, it should return the external field list it depends on, so RT could retrieve them at the beginning." "E.g.

YYY => sub {
    my %args = @_;

    return 'XXX' unless $args{external_entry};

    my @values = grep defined && length, $args{external_entry}->get_value('XXX');
    return @values;
},"

Merge request reports

Loading