hey folks, there is a problem with the html-structur.
after enabling Insert for imagefield_crop, it seemed to work, but actually you can only insert the first image. there is a constructor error in the insert.js
The problem is in the line 36.
34 var widgetType = $(this).attr('rel');
35 var settings = Drupal.settings.insert.widgets[widgetType];
36 var wrapper = $(this).parents(settings.wrapper).filter(':first').get(0);
37 var style = $('.insert-style', wrapper).val();
38 var content = $('input.insert-template[name$="[' + style + ']"]', wrapper).val();
39 var filename = $('input.insert-filename', wrapper).val();
the var wraper is undefined when fireing the "insert-button" in the imagefield_crop_widget. it always takes the first image.
i think it is a constructor error, because of all the html imagefield_crop is creating.
possible solution: what about to leave the div.image-preview and the drag-handler. the image-preview element, can be set display:none; etc. I think there are other modules using the html-core-structure to get their values.
what do you think? maybe other solutions for now?
btw: to get insert working you need to create a widget with hook_insert_widgets):
function settings_insert_widgets() {
return array(
'imagefield_crop_widget' => array(
'element_type' => 'managed_file',
'wrapper' => '.image-widget',
'fields' => array(
'alt' => 'input[name$="[alt]"], textarea[name$="[alt]"]',
'title' => 'input[name$="[title]"], textarea[name$="[title]"]',
'description' => 'input[name$="[description]"], textarea[name$="[description]"]',
),
),
);
}
Now You can easily enable the Insert-Button in your field-settings.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 0001-issue-1240838.-7.x-2.x-integrate-with-insert.module.patch | 1.06 KB | skaught |
Comments
Comment #1
bryancasler commentedsubscribe
Comment #2
wooody commentedHi , where i must add this code..??
and what if i want use it for Multiupload imagefiled and Multiupload filefiled ,
Thanks
Comment #3
wooody commentedbad support from Drupal.
Comment #4
skaughtpatch attached
Comment #5
ram4nd commented