Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By catch on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
9.3.x
Introduced in version:
9.3.0-alpha1
Issue links:
Description:
Cache tags and contexts were always sorted regardless of usage, in order to make debugging and testing more convenient, however this added a performance burden to every HTML request.
In general this will not affect any runtime code at all, however some tests may need to account for differently sorted tags/contexts, in most cases the change will look like the following:
Before:
$this->assertEquals($expected_top_level_contexts, $element['#cache']['contexts'], 'Expected cache contexts found.');
After:
$this->assertEqualsCanonicalizing($expected_top_level_contexts, $element['#cache']['contexts'], 'Expected cache contexts found.');
Impacts:
Module developers