Skip to content

Disabled local store ('local-empty' dummy) silently accepts registrations #459

@cbravobernal

Description

@cbravobernal

Description

When local fields are disabled (via acf_disable_local() or the acf/settings/local filter), acf_get_local_store() (includes/local-fields.php:87-93) returns the shared local-empty "dummy" store — but it is a normal writable ACF_Data store. Registrations made while local is disabled silently accumulate there instead of being rejected, and the same dummy instance is shared between the fields and groups paths.

Low severity (the data is never read while disabled), but it is a foot-gun: re-enabling local does not surface those registrations, and the accumulated state can confuse debugging.

Reproduction

Characterized in #450: tests/php/includes/test-local-fields.php::test_local_setting_filter_disables_local (resets the dummy store in teardown to avoid cross-test pollution).

Suggested fix

Return a write-discarding store (no-op set/append), or reset the dummy store when toggling.

Found during the 2026-06 test campaign (see PR #450).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions