collective / wildcard.media

13 stars 12 forks source link

Async convert process fails when object added #20

Closed displacedaussie closed 9 years ago

displacedaussie commented 9 years ago

Using the latest 1.2b5 release, I've noticed that the convert process fails when adding a Video while using plone.app.async.

This is because the job is queued in the video_file setter in the behavior, and at this point the Video object is still a temporary object. The context object passed to plone.app.async is therefore the parent object of the Video rather than the Video object itself, which results in an AttributeError (context.video_file) in convert/runProcess.

I've added a fix, based on the 2.0 changes in master, that queues the job for the right object using Event subscribers.

https://github.com/collective/wildcard.media/tree/fix_async_behavior

vangheem commented 9 years ago

Yes, I think this is fixed in master already. Thanks. I'll close the ticket. Please re-open if I'm incorrect. Thanks.