Closed (fixed)
Project:
ImageField
Version:
6.x-3.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2011 at 10:53 UTC
Updated:
14 Apr 2013 at 18:59 UTC
I'm using a custom form for editing content in a project and want to build in an cck image upload. So far I'm using the following code:
$element = content_fields('field_image', MY_NODE_TYPE);
$form['#field_info']['field_image'] = $element;
$element = (array) content_field_form($form, $form_state, $element);
$form['field_image'] = $element['field_image'];
This displays 2 upload-fields + 1 "add more" button.(all ajaxified) When I'm trying to upload an image via the first 2 fields the preview of the image isn't shown afterwards.
When I use the "add more" to add a new field the first 2 fields start to work again.
So my question is: What exaclty is neccessary to get the two fields to work initially? Might be some AHAH/Ajax behviours?!
Comments
Comment #1
quicksketchImageField (or generally all CCK fields) are not designed to work outside of the node form. In Drupal 7 we have a nice #type = 'managed_file' that provides a global AJAX-upload field, but what you're trying to do isn't supported in Drupal 6.
Comment #2
quicksketch