Missing argument and undefined variable 'text'
-
16-10-2019 - |
Question
Unsure on how to debug this issue. Recently started getting hundreds of these in system.log
.
- 2013-08-30T11:20:46+00:00 ERR (3): Warning: Missing argument 1 for Mage_Core_Block_Text::setText() in /var/www/vhosts/domain.com/httpdocs/app/code/core/Mage/Core/Block/Text.php on line 36
- 2013-08-30T11:20:46+00:00 ERR (3): Notice: Undefined variable: text in /var/www/vhosts/domain.com/httpdocs/app/code/core/Mage/Core/Block/Text.php on line 38
This is filling the log up at a rapid pace as they are being thrown on every page load.
Coming from the Magento core yet there have been no modifications to the core at all.
Don't suppose anyone has any ideas on this at all?
Solution
Most probably there is a block with type core/text
and the method setText
is called on your block without a parameter.
This can come from a layout file, from a declaration like this:
<block type="core/text" ...>
<action method="setText"></action><!-- missing parameter here -->
</block>
Or from a controller or other block. something like
$block = Mage::app()->getLayout()->createBlock('core/text');
$block->setText();
use xDebug and put a break point in the line suggested in the error message and see the stacktrace.
Or you can look in all your files for the text setText
and see if you can find something fishy.