Magento Debugging Tips: Filename cannot be empty

Problem You may have seen this kind of error frequently logged in your Magento log file var/log/system.log: Warning: include(): Filename cannot be empty in /app/code/core/Mage/Core/Block/Template.php on line xxx This error means Magento is trying to include a template block with an empty string set as it’s template. Solution In order to find which template file …

Read more

Using get_defined_vars() for debugging local scope variables

Suppose say, you want to debug variables in some observer method. You can either log each variable or simply dump it. But when you have many variables, debugging each variable can be an overhead task. For this purpose we can use PHP’s inbuilt function: get_defined_vars() How to use it? //put this line at the top …

Read more