summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--includes/theme.inc3
-rw-r--r--modules/simpletest/tests/theme.test9
-rw-r--r--modules/simpletest/tests/theme_test.module13
4 files changed, 27 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 27e8b7475..a48b6e99d 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.36, xxxx-xx-xx (development version)
-----------------------
+- Fixed the drupal_add_region_content() function so that it actually adds
+ content to the page.
- Added an 'image_suppress_itok_output' variable to allow sites already using
the existing 'image_allow_insecure_derivatives' variable to also prevent
security tokens from appearing in image derivative URLs.
diff --git a/includes/theme.inc b/includes/theme.inc
index ed34b8289..1833beeb8 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2622,6 +2622,9 @@ function template_preprocess_page(&$variables) {
if (!isset($variables['page'][$region_key])) {
$variables['page'][$region_key] = array();
}
+ if ($region_content = drupal_get_region_content($region_key)) {
+ $variables['page'][$region_key][]['#markup'] = $region_content;
+ }
}
// Set up layout variable.
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index f1a743e00..f5ddfa9b0 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -155,6 +155,15 @@ class ThemeTestCase extends DrupalWebTestCase {
$this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), 'Base theme\'s default settings values can be overridden by subtheme.');
$this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', 'Base theme\'s default settings values are inherited by subtheme.');
}
+
+ /**
+ * Test the drupal_add_region_content() function.
+ */
+ function testDrupalAddRegionContent() {
+ $this->drupalGet('theme-test/drupal-add-region-content');
+ $this->assertText('Hello');
+ $this->assertText('World');
+ }
}
/**
diff --git a/modules/simpletest/tests/theme_test.module b/modules/simpletest/tests/theme_test.module
index 61a12bb70..948d8175a 100644
--- a/modules/simpletest/tests/theme_test.module
+++ b/modules/simpletest/tests/theme_test.module
@@ -53,6 +53,11 @@ function theme_test_menu() {
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
+ $items['theme-test/drupal-add-region-content'] = array(
+ 'page callback' => '_theme_test_drupal_add_region_content',
+ 'access callback' => TRUE,
+ 'type' => MENU_CALLBACK,
+ );
return $items;
}
@@ -127,6 +132,14 @@ function _theme_test_suggestion() {
}
/**
+ * Page callback, calls drupal_add_region_content.
+ */
+function _theme_test_drupal_add_region_content() {
+ drupal_add_region_content('content', 'World');
+ return 'Hello';
+}
+
+/**
* Theme function for testing theme('theme_test_foo').
*/
function theme_theme_test_foo($variables) {