From 582f757f1c4b09bbde29a98abf64c9ff540785df Mon Sep 17 00:00:00 2001 From: Michelle Cox <27205-Michelle@users.noreply.drupalcode.org> Date: Thu, 10 Nov 2022 13:18:08 -0500 Subject: [PATCH] Issue #3304404 by Michelle: Null $value causing PHP 8 deprecation warning --- .../salesforce_mapping/src/SalesforceMappingFieldPluginBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php b/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php index 5f84b7f5..6a3dd71b 100644 --- a/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php +++ b/modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php @@ -242,7 +242,7 @@ abstract class SalesforceMappingFieldPluginBase extends PluginBase implements Sa break; } - if ($field_definition['length'] > 0 && strlen($value) > $field_definition['length']) { + if (!empty($value) && $field_definition['length'] > 0 && strlen($value) > $field_definition['length']) { $value = substr($value, 0, $field_definition['length']); } -- GitLab