On most of my pages employing Contemplate, Drupal is generating an empty $sidebar_left for PHPTemplate. Has anyone else encountered this problem (or something like it)?

Comments

beekay1076’s picture

Hi. Somebody please heeeeeelp!

I have Drupal 5.7 installed and am working on my own theme.
I too am getting empty $sidebar_left result
It actually comes back empty no matter what theme I use - including Garland.
I even placed this simple test into my template.php file inside the _phptemplate_variables_function

if (empty($vars['sidebar_left'])) {
  $vars['sidebar_result'] = 'sidebar_left is empty';
}

Then I placed

print $sidebar_result;

in my page.tpl.php file and sure enough it always prints 'sidebar_left is empty'

Anyone know why?
I've search and searched through Drupal.org and Google but can't find a solution

jrglasgow’s picture

what is supposed to printed in the left sidebar?

beekay1076’s picture

Well I just placed that test into template.php to see if the $left_sidebar variable contained anything.
Even though I had enabled blocks in the left sidebar, it was returning empty.

Anyhow I've now found out that it's actually a theme related problem.
It occurs when you have a different admin theme to the front-end theme.
Saving the blocks was only actually saving it for the admin theme.
Thanks anyways.

jrglasgow’s picture

Status: Active » Postponed (maintainer needs more info)

David Fisco ,
Did you find a solution like beekay1076, or are you still having problems?

eiland’s picture

Version: master » 5.x-2.02

i had the same thing after upgrading from 4.7/ It was something in the blocks table. If you have phpMyAdmin, backup your blocks table, and then drop it.

Then put the following empty blocks table in there, in stead;

CREATE TABLE `blocks` (
  `module` varchar(64) NOT NULL default '',
  `delta` varchar(32) NOT NULL default '0',
  `theme` varchar(255) NOT NULL default '',
  `status` tinyint(4) NOT NULL default '0',
  `weight` tinyint(4) NOT NULL default '0',
  `region` varchar(64) NOT NULL default 'left',
  `custom` tinyint(4) NOT NULL default '0',
  `throttle` tinyint(4) NOT NULL default '0',
  `visibility` tinyint(4) NOT NULL default '0',
  `pages` text NOT NULL,
  `title` varchar(64) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `blocks`
-- 
INSERT INTO `blocks` (`module`, `delta`, `theme`, `status`, `weight`, `region`, `custom`, `throttle`, `visibility`, `pages`, `title`) VALUES ('user', '0', 'garland', 1, 0, 'left', 0, 0, 0, '', ''),
('user', '1', 'garland', 1, 0, 'left', 0, 0, 0, '', '');
-- --------------------------------------------------------

then you need to redefine all the positions of the blocks, but thats childsplay.