Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
AJAX Example
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Dec 2017 at 19:45 UTC
Updated:
19 Jul 2018 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andeersg commentedI'm not sure it is the correct solution, but I used this example to create a form that added a row to a table with ajax. It did not work before I added the setRebuild-method in submitForm. Before that the step counter would reset to original value every time and just overwrite the new step.
Comment #3
Lal_@andeersg well I tried but it's not working. Also the Wizard with graceful degradation, w/JS turned off also not working I did lots things to make it work while porting Ajax, maybe I am missing something or completely wrong.
Comment #4
ccshannon commentedCorrect the Wizard example does not work as indicated in the Form code for 'Wizard.php'. It implies a three-step form: name, address, city.
- On the AJAX-enabled wizard, only two steps render: name and address. While on address, clicking 'next step' takes me back to step 1 (name).
- On the NON-ajax wizard, while on step 1, when I click 'next step' it simply reloads the page and gives me empty step 1 form.
Though the code does help developers envision how to implement ajax in a form to produce different 'states' within one form, the wizard example code does not really work as intended.
Don't have time to look into it now, but this is definitely a bug.
Comment #5
cosolom commentedMaybe not best solution, but works.
Comment #6
monymirza#5 works.
Comment #7
Lal_re rolled the patch and I think it good to go.... @miles23 waiting for your input
Comment #8
no sssweat commented#7 worked like a charm
The code looks beautiful, good to go 👍
Comment #9
jlbellidoUpdated the issue description adding the steps to reproduce and the expected behaviour.
Comment #10
jlbellidoHi, I've tested #7 according to the expected behaviour described at the description and it works fine. On the other hand I've run the PHPCs check it meets the coding standards. It is RTBC from my side.
Thanks!
Comment #11
jlbellidoComment #12
mile23Thanks!
Patch no longer applies.
These methods need descriptive docblocks.
Also, we need a functional JS test that goes through the repro steps from the IS. That way we can prevent a regression.
Comment #13
jlbellidoThanks @Mile23 for your quick reply!
I've just checked the patch and It applies to me:
About the other remaining tasks I agree totally.
Thanks
Comment #14
mile23Ahh, I hadn't done the pull/fetch cycle for this machine. So the patch applies. :-)
Comment #15
no sssweat commentedComment #16
jlbellidoAdding tags according to the feedback from #12
Comment #17
jlbellidoFinally after some time I was able to run and write Functional JS tests. I'm attaching new patches with the following improvements:
I was inspired by the beautiful city of Lisboa and the great Portuguese community at Drupal Dev Days Lisbon.
Comment #18
jlbellidoUps! I didn't uploaded the test-only patch. I'm trying again.
Comment #20
jlbellidoThe tests failed because I uploaded the patches in the wrong order. It seems they are passing.
Comment #22
mile23Yay devdays. :-)
Added @group examples to the test on commit.
Thanks everyone!