2

I have custom regions rendered inside of the node.tpl.php file which work as expected, but results in a php error when blocks created by the views module is placed in them.

 [:error] [pid 2563] [client 127.0.0.1:35606] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /filepath/sites/all/modules/devel_themer/devel_themer.module on line 333

Other blocks all work fine the regions and the views blocks work fine in all regions called by page.tpl.php. The error only occurs when the two are put together. There are no other log messages and the page just returns a blank screen so I'm not quite sure what the problem is or how to go about fixing it. I'm using the code below in template.php to make the region available outside of page.tpl.php

function smark_design_theme_preprocess(&$variables) {
  if (block_get_blocks_by_region('region_name')) {
    $variables['region_name'] = block_get_blocks_by_region('region_name');
  } else { $variables['region_name'] = FALSE; }      
}

And this to call the region in node.tpl.php

<?php if ($page): ?>
  <?php if ($region_name): ?>   
    <div id="region-name">
      <?php print render($region_name); ?>
    </div>
  <?php endif; ?>
<?php endif; ?>
5
  • uninstall the devel_themer module, the error comes from this module and let me know the result Commented Dec 5, 2015 at 17:40
  • No real change, browser gives 'Connection was reset' page instead of plain white, apache log gives: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /filepath/sites/all/modules/token_filter/token_filter.module on line 0 Disabling the token_filter module removes errors in apache log but browser still gives 'Connection was reset' page.
    – Salem616
    Commented Dec 7, 2015 at 11:48
  • you got some advance? Commented Dec 8, 2015 at 18:58
  • Nothing yet, I tried increasing the max_execution_time but didn't change anything.
    – Salem616
    Commented Dec 9, 2015 at 10:15
  • Your token_filter is taken a lot of time to executed some functionality, see my edit. Commented Dec 9, 2015 at 15:27

2 Answers 2

1

It's not normal to render regions inside a node template, and this is one reason why. If you display a node in a block in one of these regions, that's going to result in an infinite regression in which node.tpl.php calls itself (indirectly, via several other theme calls).

Reconsider the structure of your theme.

2

Searh your php.ini and change the value of max_execution_time to:

max_execution_time = 300

By default php.ini have 30 seconds and PHP needs more time to process it, in this case you have 300 seconds.

EDIT: As you say in your comment that your problem persist, you can use the following solution, but you need know that your site can take a lot of time to process your request.

Edit the file YOUR_SITE/sites/default/settings.php and add this in the second line and save the file:

set_time_limit(0);

Read more about this function at php.net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.