Closed (works as designed)
Project:
Draft
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2009 at 09:46 UTC
Updated:
23 Nov 2010 at 13:43 UTC
When i upload an image via Imagefield (with is done with ajax), it is not saved with the draft.
Comments
Comment #1
darren.ferguson commentedDraft has no ability to save images currently, this is not probably going to be supported in the near future since it would involve determining whether bitcache, file framework, or other uploading mechanizms would be utilized. As of this moment it definitely does not do this for images via the imagefield module.
Comment #2
giorgoskJust tested it with imagefield and draft 6.x-1.x-dev from 2009-Sep-26
and ITS WORKING but with a little glitch
when you are viewing a draft the imagefield does not appear to have been populated since there is no preview image
BUT
saving the module proves to that the imagefield was there
reediting the node will render an image preview as well
and this whole thing makes sense because the image has been saved by the ajax upload code and all the imagefield holds is a reference to it, thus it should work on previous versions as well
There probably needs an extra javascript call to make the preview image showup
Anyone have any idea how to sort this ??
changed status to active since its a little confusing to the user and if we can sort this will be great
Comment #3
giorgoskShould have changed title as well
Comment #4
pribeh commentedsubscribing.
Comment #5
darren.ferguson commentedIf you want this functionality you will have to utilize hook_draft() and provide a module to do this. This is not a feature of drafts module and the reason the hook_draft() was created was too allow people to add this functionality in their own modules.
Closing since it is not something the draft module can even begin to think handling since there are so many modules and cases and types it would be a never ending job keeping that updated.
Comment #6
pribeh commentedThanks Darren. To help move this forward then:
http://drupal.org/node/699258
Comment #7
pribeh commentedOpening again since quicksketch closed the issue over at http://drupal.org/node/699258. Its recommended that Draft provide the support as opposed to the other way around. Any chance Darren?
Best,
Thomas
Comment #8
darren.ferguson commentedThomas, your best best would be to write a very small module that implements hook_draft only and provides the functionality in imagefield that you are looking for. This is definitely not something that should be in the core draft module because drafts should not know about any other modules it just knows to take the javascript snapshot from the webpage, save in the system then re-load the same javascript snapshot when it is asked for. Any additional help needed for modules should be provided by implementing the hook_draft() functionality.
If you wish to contribute the code as a draft sub module i would gladly add it too the module if not then you can create your own module and page for this functionality.
Comment #9
pribeh commentedGreat, thanks Darren.
Comment #10
apanag commentedThe following code worked for me: