Magento Error: Method Varien_Object::__tostring() cannot take arguments in Magento
Today, I started backing up a Magento based site that will be moved in coming days. I did a bit of reading around to try to get a feel for what kind of an endeavor this would become.
The process of backing up the database and all web files were quite straight forward (as they should have been).
I decided to attempt the get this version of Magento running on my local dev box using MAMP before setting it on the newer server and repointing the DNS entries. So I imported the database and transfered all Magento files into the web directory.
Following some instructions found in the Magento forums, I modified the /app/etc/local.xml file with the new database settings in my MAMP install.
Then, I changed 2 rows in the core_config_data tables.
web/unsecure/base_url and web/secure/base_url – where I entered my local address for this test.
When I first ran the store front, I had the “blank page” come up, so I made sure that the following line was uncommented.
For the sake of this test, I also uncommented:
I should also note that this Magento code base is a rather old version. Version 1.2.1. It may be upgraded, but not at this time.
I then saw the error that lead me to write this article.
Method Varien_Object::__tostring() cannot take arguments
Since I was running PHP 5.3.2 on this MAMP installation, the __toString() method causes an error….. so I changed __toString() to __invoke().
There was one more error…. another method split() that was changed to explode().
I found an excellent reference detailing these errors on the following website. Please find further details on there.
[ad code=6 align=left]