API page: https://api.drupal.org/api/drupal/core%21modules%21system%21core.api.php...
On #2225353: Convert $form_state to an object and provide methods like setError(), $form_state was changed from an array to an object of type \Drupal\Core\Form\FormStateInterface instead of an array.
That issue fixed up the documentation pretty well, but missed two things:
a) At the bottom of the Form generation topic (link above), there's a line:
See \Drupal\Core\Form\FormBuilder::buildForm() for documentation of $form_state keys.
I think we should remove this line, and instead say at the end of the previous paragraph:
$form_state is an object that implements \Drupal\Core\Form\FormStateInterface.
b) Although the form state interface is now used in examples on this page, there is no use statement for it in the form class example at the top.
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal8-Form-generation-topic-2313089-5.patch | 1002 bytes | er.pushpinderrana |
Comments
Comment #1
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedPlease review updated patch.
Comment #2
jhodgdonOh, sorry. I think the new information should be added to the last paragraph (which is talking about $form_state), not the paragraph above that you added it to. Sorry that wasn't clear!
Comment #3
undertext CreditAttribution: undertext commentedComment #4
jhodgdonThanks, almost there!
I realized we should take out the "by reference" note in this paragraph -- it's an object, so that is not necessary to mention that it is passed by reference.
Also, we do not need the blank line at the end of the doc block, so that should be removed.
Comment #5
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedPlease review updated patch, incorporated #4 changes.
Comment #6
jhodgdonThanks! Looks good to me.
Comment #7
alexpottCommitted 402e037 and pushed to 8.x. Thanks!
Comment #10
m1r1k CreditAttribution: m1r1k commented