New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elgg_get_plugin_settings() doesn't respect default value if any settings are cached #9781

Closed
brettp opened this Issue Apr 29, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@brettp
Member

brettp commented Apr 29, 2016

    public function getSetting($name, $default = null) {
        $values = _elgg_services()->pluginSettingsCache->getAll($this->guid);

        if ($values !== null) {
            return isset($values[$name]) ? $values[$name] : null;
        }

If any settings have been saved or are cached, the if block ignores the default values, even if the cached settings don't include the setting we're requesting.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Apr 29, 2016

Member

Oops my bad.

Member

mrclay commented Apr 29, 2016

Oops my bad.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay May 2, 2016

Member

I rebased your fix on 2.1: #9788

Member

mrclay commented May 2, 2016

I rebased your fix on 2.1: #9788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment