Skip to content

Fix issues introduced in 8bcdff4 #86

@MarcMichalsky

Description

@MarcMichalsky

In commit 8bcdff4, some of the logic for testing whether or not $profile->getAttribute() returns a configuration value was changed to use isset() or is_string() instead of !empty().

The problem is that $profile->getAttribute() looks for the attribute name in it's $data property, which also contains the attribute names for config values that are not set (the value is then an empty string).

I suggest changeing $profile->getAttribute() as follows:

public function getAttribute($attribute_name, $default = NULL) {
    return $this->data[$attribute_name] ?? $default;
}
public function getAttribute($attribute_name, $default = NULL) {
    return !empty($this->data[$attribute_name]) ? $this->data[$attribute_name] : $default;
}

Or should we just revert commit 8bcdff4 instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions