Search

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'

An error occurred in /home/alberto1/webapps/symphony/symphony/lib/toolkit/fields/field.upload.php around line 237

232 [size] => 16214
233 )
234 */
235 $message = NULL;
236
237 if(empty($data) || $data['error'] == UPLOAD_ERR_NO_FILE) {
238
239     if($this->get('required') == 'yes'){
240         $message = __('‘%s’ is a required field.', array($this->get('label')));
241         return self::__MISSING_FIELDS__;`

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!!!

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details