Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
In this file fapi_example/src/Form/BuildDemo.php,
$form['actions']['rebuild'] = [
'#type' => 'button',
'#value' => 'Submit Rebuild',
'#submit' => ['::rebuildFormSubmit'],
];
'#type' => 'button',
should be changed to
'#type' => 'submit',
if not,"rebuildFormSubmit" method will not be invoked
Comment | File | Size | Author |
---|---|---|---|
#3 | 2897097_3.patch | 1.42 KB | Mile23 |
Comments
Comment #2
nicorac CreditAttribution: nicorac commented+1, thanks for it.
I've lost 2 hours to find out why my code doesn't work, then downloaded Examples module just to check if it has the same "issue" and... yes, it has ;)
I think 2 actions are needed:
- a fix to Examples module
- an update to Drupal core forms API documentation
Comment #3
Mile23Moving to major because it breaks the behavior but doesn't cause a crash.
Here's a fix. Please review.
Comment #4
Mile23Comment #5
Mile23Also, based on #2, we should find/file a core issue to update the docs.
Comment #6
Mile23Re-running the testbot.
Comment #8
Mile23And done. Thanks, folks!