Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.5
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Translate
-
Labels:None
Description
Sometimes object is passed to the $messageId (i.e. via Zend_Form instance of class with toString() magic method is passed as value)
however that $messageId is not translated and gives
PHP Warning: Illegal offset type in isset or empty in /home/www/app/library/Zend/Translate/Adapter.php on line 682
This should fix the problem
if (is_object($messageId))
$messageId = (string)$messageId;
Zend_Translate MUST have an string as key.
Other types are not allowed and should not be given.
Using toString implicitly by isTranslated() would add problems.
In my opinion it's better to have this warning to force the user to prevent those problems.