View Issue Details

IDProjectCategoryView StatusLast Update
0006763module Visual CMSmodule Visual CMS - subpublic2018-01-11 12:02
ReporterHausenberg_Acando Assigned To 
PriorityurgentSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version3.0.0 
Summary0006763: Mehrfachverwenung von Bildeingabekomponenten in einem Formular nicht möglich
DescriptionEs können pro Formular für ein Widget nur eine Bildeingabekomponente verwendet werden. Sobald man mehrere Bild-Eingabefelder definiert hat und bei der Pflege das erste Feld befüllt, sind nach dem Speichern alle Bild-Eingabefelder mit dem zuerst gewählten Bild belegt.
Steps To Reproduce1. Widget-Formular erstellen mit mindestens zwei Bild-Eingabefeldern. Z.B.
'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'),
            ),

2. Widget über das OXID User Interface anlegen und in beiden Eingabefeldern ein unterschiedliches Bild auswählen. Dann speichern. Sobald man wieder in den Bearbeitungsmodus wechselt, sieht man in den Preview-Feld bereits, dass in beiden Fällen dasselbe Bild angezeigt wird.
Additional InformationIch habe eine Anpassung in der Datei visualeditor.js vorgenommen um das Problem zu lösen. Die Anpassungen müssten im Grunde nur übernommen und getestet werden. Bei uns funktioniert die Anpassung ohne Problem.

1) Zeile 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) Zeile 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];
                                    }
                                }
                            );
                        }
TagsNo tags attached.

Relationships

duplicate of 0006764 resolvedbenjamin.joerger Multiple usage of input fields of type image not possible within one widget-form 

Activities

QA

2018-01-11 10:43

administrator   ~0012349

Thank you for your help and the detailed information.
I have to ask you for 2 small additions.
First we would need the entry to be in english to make it easier for our developers to work with it.
Second, can you provide some more in depth information about how exactly to reproduce this issue? Like which widget got used, etc.

Thanks alot in advance.

Hausenberg_Acando

2018-01-11 11:50

reporter   ~0012350

I cloned this issue and translated it to english as I could not find an editing button
https://bugs.oxid-esales.com/view.php?id=6764

Feel free to close this one