Hello Support Team,
I have got this error after upgrade my php version from 5.3.10 to 5.5.7. My application is running in drupal 7.23 in ubuntu 12.04.
Error : Strict warning: Only variables should be passed by reference in include() (line 26 of /var/www/avcdistributor.com/sites/all/themes/tejas/templates/page.tpl.php).
Line 24-28 Says :
if($user->uid != 0){ $block = block_load(‘block’, ‘7’); $output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block)))); print $output; }
Can you please help me what is the issue, it will perfectly worked on php 5.3.10, but after upgrade php version it will not working.
Thanks, Tejas
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
the problem you are having is that you are passing the return of the function call “_block_get_renderable_array” to drupal_render. drupal_render expects that parameter to be passed by reference. You can only pass a variable by reference NOT the return value of a function call.
Here is an example fix. <pre> $block = block_load(‘block’, ‘7’); $render_block = _block_get_renderable_array(_block_render_blocks(array($block))) $output = drupal_render($render_block); print $output; </pre>
For more information on resolving this issue with your code, please refer to: http://www.php.net/manual/en/language.references.pass.php <br> <br>[Not recommended] <br>However, to prevent this warnings from displaying, add “~E_STRICT” to your php.ini on the error_reporting line. Such as: <br>error_reporting = E_ALL ~E_STRICT