Skip to content

Style Editor tab hidden in Content Type Builder due to unhandled boolean value from config endpoint #35331

@rjvelazco

Description

@rjvelazco

Problem Statement

The /api/v1/configuration/config REST endpoint returns feature flag values as native JSON booleans (true/false) for FEATURE_FLAG_* keys. However, DotPropertiesService.getFeatureFlag() only compared the returned value as a string (value === 'true'), so when the API returned a boolean true, the strict comparison true === 'true' evaluated to false.

This caused the Style Editor form tab in the Content Type Builder to be permanently hidden, even when FEATURE_FLAG_UVE_STYLE_EDITOR_FOR_TRADITIONAL_PAGES was enabled on the backend.

Impact: Any feature relying on getFeatureFlag() is broken when the backend returns a JSON boolean instead of a string — silently disabling the feature with no error or warning.

Affected flags:

  • FEATURE_FLAG_UVE_STYLE_EDITOR
  • FEATURE_FLAG_UVE_STYLE_EDITOR_FOR_TRADITIONAL_PAGES

Browser: N/A (logic bug in Angular service).

Steps to Reproduce

  1. Enable FEATURE_FLAG_UVE_STYLE_EDITOR_FOR_TRADITIONAL_PAGES on the backend (via dotmarketing-config.properties or admin).
  2. Open the Content Type Builder in the dotCMS admin UI.
  3. Observe: the Style Editor form tab is not visible, even though the flag is enabled.

Root cause (code):

// Before fix — only handles string "true"
getFeatureFlag(key: FeaturedFlags): Observable<boolean> {
    return this.getKey(key).pipe(
        map((value) => (value === FEATURE_FLAG_NOT_FOUND ? true : value === 'true'))
    );
}

When /api/v1/configuration/config returns { "FEATURE_FLAG_UVE_STYLE_EDITOR_FOR_TRADITIONAL_PAGES": true } (boolean), the comparison true === 'true' is false, so the flag is treated as disabled.

Acceptance Criteria

  • DotPropertiesService.getKey() return type is updated to Observable<string | boolean> to match the actual API contract
  • getFeatureFlag() returns true when the API returns boolean true
  • getFeatureFlag() returns false when the API returns boolean false
  • getFeatureFlag() continues to return true for string "true" (backward compatibility)
  • getFeatureFlag() continues to return false for string "false" (backward compatibility)
  • getFeatureFlag() returns true when the key is not found (FEATURE_FLAG_NOT_FOUND sentinel behavior preserved)
  • The Style Editor form tab is visible in the Content Type Builder when FEATURE_FLAG_UVE_STYLE_EDITOR_FOR_TRADITIONAL_PAGES is enabled on the backend
  • Unit tests cover boolean true, boolean false, string "true", string "false", and not-found cases

dotCMS Version

Latest main branch

Severity

High - Major functionality broken

Links

NA

Metadata

Metadata

Assignees

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions