Magento Forum

   
Magento 1.3.2.4 on PHP 5.3
 
popcornollie
Jr. Member
 
Total Posts:  3
Joined:  2012-06-07
 

Hi

I’m new here, and have very limited knowledge of Magento.. so please bare with me! smile

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 errorsyntax errorunexpected T_CONSTANT_ENCAPSED_STRINGexpecting '&' 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

 
Magento Community Magento Community
Magento Community
Magento Community
 
NuBlue
Sr. Member
 
Avatar
Total Posts:  94
Joined:  2008-03-31
Lancaster, United Kingdom
 

Hi,

Is there any reason you’re still running such an old version of Magento? An upgrade may be the best way forward.

 
Magento Community Magento Community
Magento Community
Magento Community
 
popcornollie
Jr. Member
 
Total Posts:  3
Joined:  2012-06-07
 

This is an old website which I have inherited (lucky me! rasberry), neither have I worked with Magento before.

My main concern is that, while upgrading the version of Magento, the website will be relying upon plugins / custom hacks which will not be compatible with newer versions of Magento.

Is this likely to be a problem, or has Magento remained functionally consistent between these versions?

Once again, sorry for my n00b questions wink but I appreciate your help.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top