symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

fix: check first if object is null #93

Closed skrobek closed 10 years ago

skrobek commented 10 years ago

I wonder why $this->uploads in CollectionUploadSubscriber.php gives:

array( '0' => null );

Shall we first check if object is not null ?

 if ($upload === null) {
    continue;
}               
skrobek commented 10 years ago

Sorry i made second change to early, wrong PR.

ronzalo commented 10 years ago

When save a entity without images, got this error:

Call to a member function getFile() on a non-object in .../vendor/avocode/form-extensions-bundle/Avocode/FormExtensionsBundle/Form/EventListener/CollectionUploadSubscriber.php on line 160

So, your solution work it and make sense for me

sescandell commented 10 years ago

@ronzalo

The error you described was linked to the storage, not the upload parameter. Commit https://github.com/avocode/FormExtensions/commit/178ee272e8476c95ff81a84b4c55cf7e55592475 should fix this issue.

skrobek commented 10 years ago

@sescandell Can you link commit again ? :-)

sescandell commented 10 years ago

Done