Skip to main content

Community title can’t be saved in Portal Settings when the stored value is empty

Version: FluentCommunity 2.12.0 (WordPress, pt_PT locale)

Summary
In Portal Settings → General, the “Community title” field cannot be saved if the currently stored site_title is empty. The request returns success (“Settings saved successfully”), but the value is not stored, and the field is empty again after a reload.

Steps to reproduce

  1. Have fluent_community_settings with site_title empty (e.g. a fresh install where the WordPress site title was blank when the portal was first set up).
  2. Open Portal Settings, type a title in “Community title” and click Save.
  3. Reload the page. The field is empty again.

Cause
In app/Http/Controllers/AdminController.php, method saveGeneralSettings():

php

$settings = Helper::generalSettings(false);   // stored values
...
if (!empty($settings['site_title'])) {        // tests the STORED value
    $settings['site_title'] = sanitize_text_field(Arr::get($inputs, 'site_title', ''));
}

The condition checks the stored value instead of the submitted one. When the stored value is empty, the new input is never copied. It also means an existing title can never be cleared. It was probably meant to be !empty($inputs['site_title']).

Impact

  • The login/signup banner shows a truncated heading (“Welcome to “ / “Bem-vindo a “).
  • The login form title and the browser tab title are cut short.
  • Email subjects and notification references that use the title are cut short too.
  • Helper::generalSettings() only falls back to get_bloginfo('name') when the key is missing, not when it is saved as an empty string, so setting the WordPress site title afterwards does not help.

Suggested fix

php

$inputs = Arr::only($inputs, array_keys($settings));
...
if (isset($inputs['site_title'])) {
    $settings['site_title'] = sanitize_text_field($inputs['site_title']);
}

Optionally, also make generalSettings() fall back to get_bloginfo('name') when the stored title is empty.

Workaround (until fixed)

php

add_filter('option_fluent_community_settings', function ($value) {
    if (is_array($value) && empty($value['site_title'])) {
        $value['site_title'] = get_bloginfo('name');
    }
    return $value;
});

Note: This text was written by Claude Code while correcting this bug on my installation by creating a temporary mu-plugins.

If you want earn more money \ click here \

The issue has been fixed in dev, thank you.