I have created two custom regions in my theme to display RSS feeds side by side. I have added 'side-center-left' & 'side-center-right' to my front page regions in config.php in addition to 'side-pre' & 'side-post'.
// The site home page.
'frontpage' => array(
'file' => 'standard.php',
'regions' => array('side-pre', 'side-center-left', 'side-center-right', 'side-post'),
'defaultregion' => 'side-pre',
),
I have also added strings for them in my lang/en/theme_test.php file:
$string['region-side-center-left'] = 'Center-Left';
$string['region-side-center-right'] = 'Center-Right';
I also included tests for both of them at the top of my standard layout:
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
$hassidecenterleft = $PAGE->blocks->region_has_content('side-center-left', $OUTPUT);
$hassidecenterright = $PAGE->blocks->region_has_content('side-center-right', $OUTPUT);
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
I've followed that up with code to insert the content:
<?php if ($hassidecenterleft) { ?>
<div id="region-side-center-left" class="block-region">
<div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-center-left') ?>
</div>
</div>
<?php } ?>
<?php if ($hassidecenterright) { ?>
<div id="region-side-center-right" class="block-region">
<div class="region-content">
<?php echo $OUTPUT->blocks_for_region('side-center-right') ?>
</div>
</div>
<?php } ?>
Both "Center-Left" and "Center-Right" show up as options when I look on the configuration page for the RSS block. When I move the RSS block to the Center-Left side, everything works. When I add it to the Center-Right side, I get "Error writing to database".
Writing a simple test within another div I added says that $hassidecenterleft is true, and $hassidecenterright is false. I have been consistent in my naming, and even copied/pasted from one location to another to make sure there weren't any typos. I can't quite figure out what the problem is.