From 66665cfb74fcb81bb3cd65a8799057f3217a061a Mon Sep 17 00:00:00 2001 From: Brice Lenfant <165644+bricel@users.noreply.github.com> Date: Wed, 6 May 2020 21:38:55 +0300 Subject: [PATCH] Remove warning when sending empty array to multiple values properties. Notice: Undefined variable: return in RestfulEntityBase->propertyValuesPreprocessText() (line 1142 of /modules/contrib/restful/plugins/restful/RestfulEntityBase.php). --- plugins/restful/RestfulEntityBase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/restful/RestfulEntityBase.php b/plugins/restful/RestfulEntityBase.php index 212697a5..700f8257 100644 --- a/plugins/restful/RestfulEntityBase.php +++ b/plugins/restful/RestfulEntityBase.php @@ -938,6 +938,10 @@ protected function propertyValuesPreprocessText($property_name, $value, $field_i ); } + // In case the value is empty. + if (empty($value)) { + $return = []; + } // Multiple values. foreach ($value as $delta => $single_value) { if (!$instance['settings']['text_processing']) {