From bd5f92d1a0b639a1f726ca3eece205ffc0f44d34 Mon Sep 17 00:00:00 2001
From: Aaron Bauman <aaron@messageagency.com>
Date: Tue, 18 Mar 2025 13:01:43 -0400
Subject: [PATCH] Issue #3502753 by balazswmann: Call to undefined method
 ::isSyncing() during push on certain entities

---
 modules/salesforce_push/salesforce_push.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/salesforce_push/salesforce_push.module b/modules/salesforce_push/salesforce_push.module
index ffb8d1f8..2118fc50 100644
--- a/modules/salesforce_push/salesforce_push.module
+++ b/modules/salesforce_push/salesforce_push.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\SynchronizableInterface;
 use Drupal\salesforce\Event\SalesforceErrorEvent;
 use Drupal\salesforce\Event\SalesforceEvents;
 use Drupal\salesforce_mapping\Entity\MappedObject;
@@ -47,9 +48,11 @@ function salesforce_push_entity_delete(EntityInterface $entity) {
  */
 function salesforce_push_entity_crud(EntityInterface $entity, $op) {
   // Don't allow mapped objects or mappings to be pushed!
-  if ($entity->isSyncing()
-  || $entity instanceof MappedObjectInterface
-  || $entity instanceof SalesforceMappingInterface) {
+  if ($entity instanceof MappedObjectInterface || $entity instanceof SalesforceMappingInterface) {
+    return;
+  }
+  // Do not push entities which are synchronizing currently.
+  if ($entity instanceof SynchronizableInterface && $entity->isSyncing()) {
     return;
   }
 
-- 
GitLab