View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006764 | module Visual CMS | module Visual CMS - sub | public | 2018-01-11 11:49 | 2019-02-21 10:37 |
Reporter | Hausenberg_Acando | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.0.0 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0006764: Multiple usage of input fields of type image not possible within one widget-form | ||||
Description | There can only be used one input field of type image within one form. If one defines more than one input fields of type image within one form and the end-user chooses different images for the different input fields after saving all image input fields have the same image reference. It is the image of the first input field, which is also referenced by the other input fields. I`d like to provide you my js-file but either .js nor .txt nor .zip files are accepted. You could contact me and I will send you an email. This is a clone to https://bugs.oxid-esales.com/view.php?id=6763 as you prefer english description and I can`t find an edititng button. | ||||
Steps To Reproduce | As there is no standard widget in the core delivery which contains more than one input field of type image, one have to create a new widget with at least two input fields of type image. E.g. 'image_desktop' => array( 'type' => 'image', 'label' => $this->trans('SHORTCODE_SERVICE_TEASER_DESKTOP_IMAGE'), 'preview' => true, 'validation' => 'required', 'validationErrorMsg' => $this->trans('SHORTCODE_VALIDATION_REQUIRED'), ), 'image_mobile' => array( 'type' => 'image', 'label' => $this->trans('SHORTCODE_SERVICE_TEASER_MOBILE_IMAGE'), 'preview' => true, 'validation' => 'required', 'validationErrorMsg' => $this->trans('SHORTCODE_VALIDATION_REQUIRED'), ), As a next step one has to create the widget via the OXID User Interface. In both image input fields one has to choose two different images. Then save the form. If one then restart the edititing modus, one can already see in the preview that in all cases the same image is being referenced. | ||||
Additional Information | I made some changes in the file visualeditor.js to solve this problem. You can overtake my changes and merge it in your developing branch. Of course it should be tested on your site. On our site it works fine. 1) Row 1033 VisualEditor.prototype.serializeInputImages = function ( $target ) { var data = []; if ( $target.data( 'multi' ) === '1' ) { $( '.dd-widget-item-col', $target ).each( function () { data.push( $( '.dd-widget-image-item', this ).data( 'file' ) ); } ); } else { $($target).each(function (){ data.push( $( '.dd-widget-item-col .dd-widget-image-item', this ).first().data( 'file' ) ); }) } return data; }; 2) Row 1479 if ( $imageList.length ) { $imageList.each( function (index) { var type_match = $( this ).data( 'input-name' ).match( new RegExp( "^" + type + "\\\[([^\\\]]*)\\\](\\\[?)" ) ); if( type_match ) { params[ type_match[ 1 ] ] = self.serializeInputImages($imageList)[index]; } } ); } | ||||
Tags | No tags attached. | ||||