Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.1 breaks conditions on second page with contao-mp_forms #44

Closed
sekmedia opened this issue Nov 11, 2020 · 18 comments
Closed

2.3.1 breaks conditions on second page with contao-mp_forms #44

sekmedia opened this issue Nov 11, 2020 · 18 comments

Comments

@sekmedia
Copy link

We use conditionalformfields combined with mp_forms in contao 3.5. All conditions work on first page, on second page we get an js error in line 115:

Uncaught TypeError: t.settings.previousValues.slice is not a function

We resolved this by now by rolling back to 2.3.0.

@jommbee
Copy link

jommbee commented Nov 12, 2020

I can confirm the problem. I have a fresh Contao 4.9 installation with the extensions mp_forms and conditional for testing. Nothing else is included. No JS or anything else.
The error only comes after sending the form to step 2. but it is still there if go back to step one. Only clearing all Browser Chaches/Cookies helps to let the script work again in step one.

@richardhj
Copy link
Member

Can you elaborate on the problem?
My first guess is that typeof t.settings.previousValues === 'undefined'. Is there a workaround?

@jommbee
Copy link

jommbee commented Nov 12, 2020

I have no Idea. You can try the clear Install and watch the console: https://bughunting.eccoweb.de/
If you want access, let me know.

@richardhj
Copy link
Member

Kannst du es mal mit der Datei probieren? https://pastebin.com/s50yif3j

@jommbee
Copy link

jommbee commented Nov 12, 2020

Wirft jetzt keinen Fehler mehr in der Console. Funktioniert initial. Nach Wechsel auf Seite zwei und dann zurück funktioniert es mal, mal nicht, das Feld zu schließen.

@m-vo
Copy link

m-vo commented Nov 16, 2020

@richardhj Can confirm the issue. Your fix from #44 (comment) works for me.

@richardhj
Copy link
Member

@m-vo do you use mp_forms?

@m-vo
Copy link

m-vo commented Nov 16, 2020

Yes. (I only noticed the error in this combination.)

@jommbee
Copy link

jommbee commented Nov 16, 2020

#44 works with simple text fields. With hidden checkbox menus as mandatory field there are problems. https://bughunting.eccoweb.de/
After one step back, the field cannot be deselected.

@richardhj
Copy link
Member

Please checkout version 2.3.2 and provide feedback. Thanks!

@m-vo
Copy link

m-vo commented Nov 16, 2020

Looks good so far!

@jommbee
Copy link

jommbee commented Nov 16, 2020

Test case with mandatory checkbox menu does not work .

@richardhj
Copy link
Member

What is the actual behavior and the intended behavior?

@jommbee
Copy link

jommbee commented Nov 16, 2020

User should make a selection. When clicked the fieldset Checkbox, the hidden field is displayed (mandatory).
So long user can go a step forward.
Then in the second step data is displayed (for example), user can click back to change data (unckech fieldset and hide mandatory field). But this is not possible now.

The mandatory field is hidden if user unchecked the fieldset Checkbox. But the form cannot be sent because the hidden mandatory field is invalid. Thus the user does not come any longer to step 2.

It also makes no difference between uncheck all fields (hidden mandatory and fieldset checkbox).

By default the hidden checkbox remains checked when it is hidden.

You can see it on example page.

@jommbee
Copy link

jommbee commented Nov 17, 2020

Da mein Englisch Kraut und Rüben ist, hier nochmal eine Erklärung:
Was ich möchte:
Ein verstecktes Checkboxmenü als Pflichfeld (field1) auf der ersten Seite (funktioniert)
Die Möglichkeit von Schritt 2 zurück zu Schritt 1 zu kommen (funktioniert)
Hier dann das Feld (field1) wieder zu deaktivieren (wird versteckt)
Dann wieder zu Schritt 2 (funktioniert nicht): Egal ob das versteckte Feld einen Wert hat oder nicht, das Formular wird nicht gesendet.

Die Möglickeit ein Pflichfeld ein und auszublenden sollte in jedem Schritt gegeben sein, egal ob man neu mit der Eingabe beginnt, oder einen Schritt zurück geht, um Eingaben zu ändern.

@richardhj
Copy link
Member

Das Ein- und Ausblenden des Feldes funktioniert ja aktuell. Aktuell schlägt die Servervalidierung fehl. Kannst du das bestätigen?

@jommbee
Copy link

jommbee commented Nov 17, 2020

Ja, ein und ausblenden klappt. Blendet man das Feld nach fehlgeschlagenem Sendeversuch wieder ein sieht man auch die error message "Bitte füllen Sie dieses Feld aus!". Es greift also die Validierung.

@richardhj
Copy link
Member

Fixed in v2.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants