|
Hi
I’m new here, and have very limited knowledge of Magento.. so please bare with me!
We have a site running Magento 1.3.2.4, which was happily working on PHP 5.2. Our web host has recently upgraded to PHP 5.3, and the website started displaying errors in reference to the
Varien_Object::__toString()
method.
There is a well documented fix for this which I’ve found in multiple places online - for example here: http://www.learnmagento.org/magento-tutorials/fatal-error-method-varien_object__tostring-cannot-take-arguments/
The quick-fix above solved the
__toString()
errors. However, now I am seeing the following error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '&' or T_VARIABLE in /home/gpcsuppl/public_html/lib/Varien/Object.php on line 499
So the error exists in the same file that I’ve already edited, although not on a line that I’ve touched.
The line in question is simply the declaration of the public toString() method. Snippet:
491: /** 492: * Public wrapper for __toString 493: * 494: * Will use $format as an template and substitute {{key}} for attributes 495: * 496: * @param string $format 497: * @return string 498: */ 499: public function toString($format='') 500: { 501: if (empty($format)) { 502: $str = implode(', ', $this->getData()); 503: } else { 504: preg_match_all('/\{\{([a-z0-9_]+)\}\}/is', $format, $matches); 505: foreach ($matches[1] as $var) { 506: $format = str_replace('{{'.$var.'}}', $this->getData($var), $format); 507: } 508: $str = $format; 509: } 510: return $str; 511: }
I can’t figure out what’s throwing it off. It doesn’t make any sense!
Google doesn’t seem to be much help, either.. I can only find 1 other case of this - here: http://www.magentocommerce.com/boards/viewthread/75995/
Has anybody seen this before?
I would appreciate any help that you can throw my way!
Thanks
|