summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-05-25 04:56:41 (GMT)
committer Alex Pott2013-05-25 04:56:41 (GMT)
commitc9ff2332f9eda724af8d02fd0543d731caadd7d5 (patch)
tree5eb0acad9bde64a735f50794f072c2fffbbe55e1
parentdc98af824297b924f39335ee2d2c7307640cdcb7 (diff)
Revert "Issue #1987952 by brantwynn, Freemantus: Fixed Order of rendered blocks is wrong."
This reverts commit 4f6113f56639caf2881188f2a6f5144273ae1399.
-rw-r--r--core/modules/block/block.module4
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php63
2 files changed, 0 insertions, 67 deletions
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 9e93550..8b24c9d 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -465,10 +465,6 @@ function block_list($region) {
$blocks[$region] = array();
}
- uasort($blocks[$region], function($first, $second) {
- return $first->weight < $second->weight ? ($first->weight === $second->weight ? 0 : -1) : 1;
- });
-
return $blocks[$region];
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php
deleted file mode 100644
index d69d844..0000000
--- a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of Drupal\block\Tests\BlockRenderOrderTest.
- */
-
-namespace Drupal\block\Tests;
-
-use Drupal\simpletest\WebTestBase;
-
-/**
- * Tests block HTML ID validity.
- */
-class BlockRenderOrderTest extends WebTestBase {
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = array('block', 'block_test', 'search');
-
- public static function getInfo() {
- return array(
- 'name' => 'Block Render Order',
- 'description' => 'Test blocks are being rendered in order by weight.',
- 'group' => 'Block',
- );
- }
-
- function setUp() {
- parent::setUp();
- // Create a test user.
- $end_user = $this->drupalCreateUser(array(
- 'access content',
- 'search content',
- ));
- $this->drupalLogin($end_user);
- }
-
- /**
- * Tests the render order of the blocks.
- */
- function testBlockRenderOrder() {
- //Enable test blocks and place them in the same region.
- $blocks = array(array($this->randomName(8), 'system_powered_by_block'), array($this->randomName(8), 'search_form_block'));
- foreach ($blocks as $weight => $settings) {
- $this->drupalPlaceBlock($settings[1], array(
- 'label' => $settings[0],
- 'weight' => $weight,
- 'region' => 'header',
- ));
- }
- $this->drupalGet('');
- $test_content = $this->drupalGetContent('');
- foreach ($blocks as $weight => $settings) {
- $this->assertRaw('<h2>' . $settings[0] . '</h2>', 'Block "' . $settings[0] . '" is in place.');
- $position[$weight] = strpos($test_content, $settings[0]);
- }
- $this->assertTrue($position[0] < $position[1], 'The blocks are rendered in the correct order.');
- }
-}