Search

This might be a Symphony bug and not with the Unique Upload field. Have you updated Symphony or installed fresh? In 2.1.0 there was a bug fix here that allows the size column to be NULL.

Also, what might be a stupid question… How hard would it be to swap out the Unique Upload Field for the bog standard File Upload Field without having to re-upload every file?

Should be relatively easy. Find the field in sym_fields and change the type column to the field type you want. Then find the same ID in sym_fields_uniqueupload and move that row into sym_fields_upload table instead. Because the schema of these two tables are identical (because the fields are virtually identical) you’re able to do this very easily.

I updated it yesterday using the Github files. How would I run that fix now that it’s updated?

Looks like this has been reported before. Not sure why it didn’t work for you.

http://getsymphony.com/download/extensions/issues/view/20653/1/

@dougoftheabaci: have you done a git submodule update?

The update won’t work for the Unique Upload field.

The Unique Upload field extends most of the core Upload field (which is great), but in this case the updater (linked by Nick) will only update any fields as specified in sym_fields_upload. Unique Upload field stores it’s information in sym_fields_uniqueupload so the Symphony Updater doesn’t touch those fields.

You could replicate that logic in the updater for your own fields if you’d prefer not to convert your field.

Looks like this issue might be solved with an improved version of the Unique Upload field (which might do a Symphony version check and some database table updates if required). I will take a look later today.

@dougoftheabaci: have you done a git submodule update?

It may be that I just woke up… But I’m not sure what you mean? When I installed Symphony 2.1.0 I grabbed the latest versions of all the extensions I was using as well, if that answers your question.

It seems that there are some issues (in Symphony 2.1) with the standard upload field as well. I will try to get this sorted before I care for my Unique Upload Field extension.

Is there any further word on this or how to fix it? I may just end up converting the field over, depending on how intensive that looks like it’ll be.

Here is the issue with the standard upload field I was talking about. (This means that something has gone wrong with 2.1.0, and I will try to stick to 2.0.8 RC3 for a while.)

I will try and wrap my mind about the problem as soon as possible — this might mean “on the weekend”, bit still I hope I will make it sooner.

Is it possible to revert at least this part of the functionality back to 2.0.8RC3? Or is that a pipe dream?

That’s a question for Alistair, I guess.

Quick fix: In field.upload.php, line 377 replace if(!is_array($data)){ with if(!is_array($data) && !empty($data)){

This might pop up another bug (the reason the code was there in the first place..), so I will look for a better solution.

Figured it out, my previous comment was close, but not close enough.

If, before the ORIGINAL if statement mentioned above, this is inserted:

        if($data === NULL){
            return array(
                'file' => NULL,
                'mimetype' => NULL,
                'size' => NULL,
                'meta' => NULL
            );
        }

everything works again.

EDIT: Pull request sent.

Implemented and it works as far as I can tell… Awesome!

Implemented and it works as far as I can tell… Awesome!

Good to hear!

Damn it! I spoke too soon. I changed line 377 to if(!is_array($data) && !empty($data)){ and added just before it:

if($data === NULL){
    return array(
        'file' => NULL,
        'mimetype' => NULL,
        'size' => NULL,
        'meta' => NULL
    );
}

However, I’m still getting that same error when a Unique Upload Field is empty and not required.

Damn it! I spoke too soon. I changed line 377 to if(!is_array($data) && !empty($data)){ and added just before it:

The fix posted in my first comment is replaced by the fix in the second comment.

So like 377 should only contain if(!is_array($data)){

If I read my post above I see I should have put it differently. Will update the posts.

Please let me know if that fixes the error.

Still getting the same error. My code now looks like this:

## Its not an array, so just retain the current data and return

if($data === NULL){
    return array(
        'file' => NULL,
        'mimetype' => NULL,
        'size' => NULL,
        'meta' => NULL
    );
}

if(!is_array($data)){   
    $status = self::__OK__;

Can you give more details on when the error happens?

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