Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
+++ b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
@@ -748,33 +783,11 @@ class InlineParagraphsWidget extends WidgetBase {
+ $field_state = static::getWidgetState($this->parents, $field_name, $form_state);
The two set/get calls to this were there before, we're just renaming variables. I think changing that would be better to be done.
Comments
Comment #2
BerdirYou can do better than that with the issue title
Comment #3
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedTried to find this, but isn't the renaming done in the #2830550: Create helper methods for "Add paragraphs" modes issue?
Comment #4
miro_dietikerThis is not about renaming. It's about reducing the code to only set the widget state once.
Line 771
Line 820
The problem is that in between we call formSingleElement that then does a formElement
And the formElement gets the widget state again at line 223:
Added a comment, so this is needed and OK.