File Upload field / Illegal string offset 'error'
This is an open discussion with 4 replies, filed under Troubleshooting.
Search
What is the output of var_dump($data); die();
if you placed that statement on line 236?
Also, what version of PHP?
I think this can occur if the <form>
element doesn't have the correct multipart attribute set. You need this for posting binary files.
I'm going to hazard a guess that the Web Faction server is running stricter error reporting measures or PHP 5.4.
Make the if
look like, if(empty($data) || (isset($data['error']) && $data['error'] == UPLOAD_ERR_NO_FILE)) {
should resolve the issue (I'll patch the file now)
EDIT It appears that @jmoont already spotted this and his fix has been committed to the integration
branch on Github. It will be available in Symphony 2.3.1 (~a month).
@brendo
While waiting for Symphony 2.3.1 I’ve “manually“ edited the “field.upload.php” file with the fix by @jmoont and everything now is working properly – no more errors – thank you very much for your precious help!!!
@Lewis + @nickdunn
Brendan’s suggestion worked first time round: nonetheless thank you a lot for your help!
Create an account or sign in to comment.
I stumbled into this error while trying to save the changes of an entry of a section containing an Upload File field:
` Symphony Warning: Illegal string offset 'error'
I’m not able to understand the cause of such an error: it presents itself only on the version of the website (Symphony 2.3) I installed in Web Faction (the two other versions I installed on my local machine and in Aruba are working fine) and only when I try to save the changes of an entry (if I try to create a new one, everything works fine…).
As a temporary solution I commented the if statement in the “field.upload.php” file, but such a move doesn’t make me comfortable at all….
Do you have any idea/suggestion about what could be the cause?
Thank you very much!!!