215 Posts
iliil
6 years ago
Topic

Hello

There is a small bug in the Upload jQuery plugin that makes it not working.

The bug occurs only in File mode (images work fine).

The ajax response adds this PHP warning before returned JSON.

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\dt-dev\plugins\cck_field\upload_jquery\classes\upload_jquery.php on line 344

That causes JSON syntax error

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

The row 344 of PHP file mentioned in the warning contains this code

if ( !count( $media_validation ) ) {

return true;

}

When I comment this condition everything seems to work ok.

Cheers

Michal


Get a VIP membership
6 years ago
1
Level 1

Hi Michal,  

thanks for your feedback, we'll have a look.  

Yes it's possible that some warning can stay and break the json return.

Also, can you try to add the validation "Upload Jquery" on your field. We always do that, so it's possible that we don't see the warning.

Regards.

215 Posts
iliil
6 years ago
0
Level 2

Hi Loinel

Yes, it seems that if the jQuery validation is on, the warning is gone.

Thanks

Michal

Get a Book for SEBLOD