Follow-up for #2663410: calling TypedConfigManager::getDefinition() causes cache pollution

Created on 8 November 2023, 10 months ago

Problem/Motivation

Discovered in πŸ“Œ Configuration schema & required keys Fixed .
πŸ› TypedConfigManager::_getDefinitionWithReplacements() incorrectly replaces generic definition Fixed introduced a regression: it introduced a bug that made TypedConfigManager sensitive to cache pollution. In the
case of hitting the $type = "$type||$sub_type"; edge case, 2 calls to getDefinitionWithReplacements() happen:

Steps to reproduce

  1. buildDataDefinition() calls it WITH the $replace parameter
  2. getDefinition() calls it WITHOUT the $replace parameter

Calling getDefinition() causes the computed type to be overwritten.

Proposed resolution

Clearing the definitions cache is a temporary work-around:

$this->getTypedDataManager()->clearCachedDefinitions();

(after calling ::getDefinition(), to allow all subsequent typed config manager logic execution to work correctly)

Remaining tasks

Test coverage.

User interface changes

None.

API changes

None.

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024