Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue with deferred image process for single occurring image fiel... #406

Open
wants to merge 1 commit into
base: 7.x-1.x
Choose a base branch
from

Conversation

chrisschaub
Copy link
Contributor

Fixing issue with deferred image process for single occurring image fields. Now all images are processed with jQuery Deferred() and when.done they options.success is fired. Still need to handle multiple images per field, but this gets us close and fixes the issue where multiple image fields on a form create multiple nodes; renamed local function _image_field_form_validate to _image_fields_form_validate to better describe its function.

…ields. Now all images are processed with jQuery Deferred() and when.done they options.success is fired. Still need to handle multiple images per field, but this gets us close and fixes the issue where multiple image fields on a form create multiple nodes; renamed local function _image_field_form_validate to _image_fields_form_validate to better describe its function
@chrisschaub
Copy link
Contributor Author

Just bumping this in case you didn't see it. Also, the "when" approach has an advantage over recursive success because all image uploads happen in parallel, not one after the other. And then when done, the validate fires.

It might be cool to move the validate for "non-image" fields before we try an upload just to catch any other fields that need address before we upload to the server. Maybe a smaller validate that just checks and prints warnings. Otherwise, the images upload, and then you get notified you missed a required field. And then the images have to get uploaded again.

@signalpoint
Copy link
Owner

Thanks Chris, I am going to wait until after the next recommended release
to merge in this pull request (just a few more days).

On Tue, Nov 18, 2014 at 11:08 AM, Christopher Schaub <
[email protected]> wrote:

Just bumping this in case you didn't see it. Also, the "when" approach has
an advantage over recursive success because all image uploads happen in
parallel, not one after the other. And then when done, the validate fires.

It might be cool to move the validate for "non-image" fields before we try
an upload just to catch any other fields that need address before we upload
to the server. Maybe a smaller validate that just checks and prints
warnings. Otherwise, the images upload, and then you get notified you
missed a required field. And then the images have to get uploaded again.


Reply to this email directly or view it on GitHub
#406 (comment).

Regards,
Tyler Frankenstein

http://www.tylerfrankenstein.com

@chrisschaub
Copy link
Contributor Author

Any update on this request?

@signalpoint
Copy link
Owner

@chrisschaub Does this code change still work for you as expected? i.e. it works on a compiled Android/iOS device?

@signalpoint
Copy link
Owner

@chrisschaub I'll trust your judgement on this and merge it in (we really need some automated tests), just please confirm it is still good to go.

@signalpoint
Copy link
Owner

@chrisschaub A friendly reminder, is this still good to go? I'll trust your judgement, I just want one last confirmation that it works. Please test one more time with all the latest changes pulled in and confirm, thanks!

@chrisschaub
Copy link
Contributor Author

Hmmm. I'll be testing more again this week. The biggest issue is a progress
indicator and maybe validation. It really becomes an issue on the phone,
showing upload progress. Especially if you have more than one image. The
other major issue is that the files upload before all form validate stuff
happens in Drupal. So, there is a possibility that the files upload and
then a form error happens. It would almost be better to save the entity and
then fire off the images afterwards, update the node as each save returns.
But that would require a bunch of rework to the file module. The file
upload process could be async and just be happening, but the node is
already saved.

On Wed, Mar 18, 2015 at 9:51 PM, Tyler Frankenstein <
[email protected]> wrote:

@chrisschaub https://github.com/chrisschaub A friendly reminder, is
this still good to go? I'll trust your judgement, I just want one last
confirmation that it works. Please test one more time with all the latest
changes pulled in and confirm, thanks!


Reply to this email directly or view it on GitHub
#406 (comment).

Christopher Schaub
http://chris.schaub.com

@signalpoint
Copy link
Owner

@chrisschaub Interesting idea. I like the idea of saving the node right away, and then using a post processor to upload the images afterwards. It wouldn't be too bad, a tricky part would be rendering the image on the node page view afterwards though, since the app will auto navigate to that page, ready to render an image, but it wouldn't be uploaded yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants