- @quietone opened merge request.
- Status changed to Needs review
7 months ago 7:40am 25 August 2024 - 🇳🇿New Zealand quietone
Changed to use a phrase of the form, "'rebuild' has been set to TRUE", which is from the docs for \Drupal\Core\Form\FormState::$rebuild.
- Status changed to Needs work
7 months ago 12:02pm 25 August 2024 - 🇬🇧United Kingdom joachim
> I don't think this an improvement, we're taking an awkwardly phrased comment about an API method and making it about a protected property instead.
Agreed -- the protected property is internal.
> If 'rebuild' has been set to TRUE
This doesn't help either. How do I find out more about what 'rebuild' is and how to set it or check for it?
> What about 'If $form_state->isRebuilding() returns TRUE" at least for the first part of the comment.
Maybe. It depends whether the reader of this documentation is trying to know
A. 'how do I know which behaviour I will get here' --> isRebuilding() is the key thing because that's how you find out
B. 'how do I influence which behaviour I will get here' --> isRebuilding() is one step removed from this AND its docs don't tell you how to change that status, and what you actually need to know about is setRebuild()I'd lean towards B.
- First commit to issue fork.
- 🇧🇷Brazil brandonlira
Hi,
I’ve updated the inline documentation in processForm() (in FormBuilder.php) to clarify the usage of isRebuilding() and setRebuild(). The changes now specify that isRebuilding() is a getter that returns TRUE when the rebuild flag is set (via setRebuild(TRUE)), rather than implying that it can be directly set.I hope this addresses the feedback from earlier comments. Please review my changes in MR ![!9319] and let me know if further adjustments are needed.
- 🇬🇧United Kingdom joachim
> // If $form_state->isRebuilding() returns TRUE and input has been processed
This is correct and accurate, but from the POV of DX, it doesn't fix the problem.
The original docs approach this from answering the question, 'what do you need to do to the form to get this behaviour?'
> If $form_state->isRebuilding() has been set
It's just that the technical detail is wrong.
We need to change the detail, not the meaning being conveyed.
- 🇧🇷Brazil charlliequadros
Hi @joachim,
it's not clear what the comment is meant to convey. To me, it should include something like:// If $form_state->isRebuilding() was set by $form_state->setRebuild() and the input was // processed without validation errors, we are in a multi-step workflow // that is not yet complete. In this case, a new $form needs to be constructed based on // the changes made to $form_state during the request.