Skip to content
Snippets Groups Projects
Commit 943b8f72 authored by catch's avatar catch
Browse files

Issue #3333858 by miiimooo, larowlan: Blocks that have #attached set removed after upgrade

(cherry picked from commit de66aa93)
parent 3371fa4c
No related branches found
No related tags found
11 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons,!3494Issue #3327018 by Spokje, longwave, xjm, mondrake: Update PHPStan to 1.9.3 and...,!3410Issue #3340128: UserLoginForm::submitForm has some dead code,!3389Issue #3325184 by Spokje, andypost, xjm, smustgrave: $this->configFactory is...,!3381Issue #3332363: Refactor Claro's menus-and-lists stylesheet,!3307Issue #3326193: CKEditor 5 can grow past the viewport when there is a lot of content
......@@ -187,7 +187,7 @@ public static function setAttributes(array &$element, array $map) {
/**
* Indicates whether the given element is empty.
*
* An element that only has #cache, #weight, or #attached set is considered
* An element that only has #cache or #weight set is considered
* empty, because it will render to the empty string.
*
* @param array $elements
......@@ -197,7 +197,7 @@ public static function setAttributes(array &$element, array $map) {
* Whether the given element is empty.
*/
public static function isEmpty(array $elements) {
return \array_diff(\array_keys($elements), ['#cache', '#weight', '#attached']) === [];
return \array_diff(\array_keys($elements), ['#cache', '#weight']) === [];
}
}
......@@ -188,13 +188,13 @@ public function testIsEmpty(array $element, $expected) {
public function providerTestIsEmpty() {
return [
[[], TRUE],
[['#attached' => []], TRUE],
[['#attached' => []], FALSE],
[['#cache' => []], TRUE],
[['#weight' => []], TRUE],
// Variations.
[['#attached' => [], '#cache' => []], TRUE],
[['#attached' => [], '#weight' => []], TRUE],
[['#attached' => [], '#weight' => [], '#cache' => []], TRUE],
[['#attached' => [], '#cache' => []], FALSE],
[['#attached' => [], '#weight' => []], FALSE],
[['#attached' => [], '#weight' => [], '#cache' => []], FALSE],
[['#cache' => [], '#weight' => []], TRUE],
[['#cache' => [], '#weight' => [], '#any_other_property' => []], FALSE],
[
......@@ -207,9 +207,9 @@ public function providerTestIsEmpty() {
FALSE,
],
// Cover sorting.
[['#cache' => [], '#weight' => [], '#attached' => []], TRUE],
[['#attached' => [], '#cache' => [], '#weight' => []], TRUE],
[['#weight' => [], '#attached' => [], '#cache' => []], TRUE],
[['#cache' => [], '#weight' => [], '#attached' => []], FALSE],
[['#cache' => [], '#weight' => []], TRUE],
[['#weight' => [], '#cache' => []], TRUE],
[['#cache' => []], TRUE],
[['#cache' => ['tags' => ['foo']]], TRUE],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment