Created
February 15, 2017 17:11
-
-
Save markconroy/0f73bd13b06c48b53f8dd6d860d07542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php | |
index 0859058..7dbd166 100644 | |
--- a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php | |
+++ b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php | |
@@ -574,12 +574,14 @@ class InlineEntityFormComplex extends InlineEntityFormBase implements ContainerF | |
} | |
} | |
// Sort values by weight. | |
- uasort($values, '\Drupal\Component\Utility\SortArray::sortByWeightElement'); | |
- // Let the widget massage the submitted values. | |
- $values = $this->massageFormValues($values, $form, $form_state); | |
- // Assign the values and remove the empty ones. | |
- $items->setValue($values); | |
- $items->filterEmptyItems(); | |
+ if (!is_null($values)) { | |
+ uasort($values, '\Drupal\Component\Utility\SortArray::sortByWeightElement'); | |
+ // Let the widget massage the submitted values. | |
+ $values = $this->massageFormValues($values, $form, $form_state); | |
+ // Assign the values and remove the empty ones. | |
+ $items->setValue($values); | |
+ $items->filterEmptyItems(); | |
+ } | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment