I am currently setting a Magento v1.7 ecommerce store on nginx with PHP 5.4. I have been monitoring the Magento store for errors and have been getting a few of them. I wanted to make a list of the errors that I am getting with the fixes. I hope these fixes will help other. And of course, please comment if you have a few to add to the list or if the fix on the post is not correct.
ERR (3): Warning: Illegal string offset 'value' Â in /app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php on line 111
I have been getting the above error in saving configuration in backend.
Fix:
Replace at line 111:
} elseif ($v['value']==$defText) { $defTextArr[] = $v['label']; break; }
To:
} elseif (isset($v['value'])) { if ($v['value']==$defText) { $defTextArr[] = $v['label']; break; } }
If you have problem with Magento not generating PDF form invoice or anything PDF related.
and comment out:
//abstract public function __construct(); //abstract public function __destruct();
Check out page problems with Log in and quantity updates.
By inserting:
<?php echo $this->getBlockHtml('formkey'); ?>
Right after:
<form id="login-form">
You may need to use grepWin to search for the location with the error, your theme may vary.
Hi did you find any other issues using PHP 5.4 with 1.7 magento e-commerce community? I am surprised there are not more developers mentioning issues with 5.4 and mage installs as it is being a bit weird for me right now! đŸ™‚
I did have a few, but forgot where I changed. Do you have some that you would like to add to the list?
Great it works nicely, thanks
Wow what a great find! This fix worked and honestly I’m quite surprised I could find something on this system error within the first few search results!
Great fix. Works perfectly.
I also found issues with lib/Zend. PHP 5.4.x and up has a more stricter ruleset for inheritance and i found many lib/Zend classes break. This is because Magento has not updated the Zend library for some time now.
Tested this on Magento CE 1.8.1.0 and EE 1.13.1.0 and both have the same issue. It is recommended that you use PHP 5.3.x as per Magento.
We are currently using PHP 5.4.4 and patching our Magento instance as we go along. I can also confirm that the “Illegal string offset ‘value'” error is an issue in 5.4.x and that this fix works.
Yes, you are right. When enough errors comes along, it makes me want to install the PHP 5.3.X. Now that business is settling down, I need to resume on those errors. Time to upgrade to 1.8.1.0 as well. Thank you for your comment.
Thank you, thank you, thank you! My PDF invoices would not print any more after moving web hosts until I found this fix. You’re a STAR!
Thanks you. I’ve gotten the same warning (ERR(3)) as I switched languages in backend.
The error
ERR (3): Warning: Illegal string offset 'value' in /app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php on line 111
is really from the inconsistent implementation oftoOptionArray in the following two models:
Mage_Paypal_Model_System_Config_Source_PaymentActions
Mage_Paypal_Model_System_Config_Source_PaymentActions_Express
If you override each of those models and replace the
toOptionArray
method with this one, it resolves the error without modifying the core code unnecessarily.Two more models which need the same overriding are:
Mage_Paypal_Model_System_Config_Source_RequireBillingAddress
Mage_Paypal_Model_System_Config_Source_Logo
Hi Guys, Just to mention that the proposed fix distorts the logic of the condition so you would be better fixing it with the following:–
This:- } elseif ($v[‘value’]==$defText) {
Becoming:- } elseif (isset($v[‘value’]) && $v[‘value’]==$defText) {
The above fixes the error.
Hello, thank you very much for the tips.
It solved a problem I was having in Customer Configuration admin section, when I couldn’t access it.
And I’m using Magento CE 1.9 !
Would you have a hint about how to fix this other problem?
http://magento.stackexchange.com/questions/43331/magento-form-key-mini-cart
It’s related with form key, which is obligatory for frontend forms since 1.8v.
Thank you again.
Thanks bro, it was helpful.
This `ERR (3): Warning: Illegal string offset ‘value’ in /app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php on line 111` was masked in Magento 1.9.x.x.