Skip to content
Snippets Groups Projects
Commit b6a44585 authored by Aaron Bauman's avatar Aaron Bauman
Browse files

Issue #3502753 by balazswmann: Call to undefined method ::isSyncing() during...

Issue #3502753 by balazswmann: Call to undefined method ::isSyncing() during push on certain entities
parent 2ab1cdb0
Branches
Tags
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\SynchronizableInterface;
use Drupal\salesforce\Event\SalesforceErrorEvent; use Drupal\salesforce\Event\SalesforceErrorEvent;
use Drupal\salesforce\Event\SalesforceEvents; use Drupal\salesforce\Event\SalesforceEvents;
use Drupal\salesforce_mapping\Entity\MappedObject; use Drupal\salesforce_mapping\Entity\MappedObject;
...@@ -47,9 +48,11 @@ function salesforce_push_entity_delete(EntityInterface $entity) { ...@@ -47,9 +48,11 @@ function salesforce_push_entity_delete(EntityInterface $entity) {
*/ */
function salesforce_push_entity_crud(EntityInterface $entity, $op) { function salesforce_push_entity_crud(EntityInterface $entity, $op) {
// Don't allow mapped objects or mappings to be pushed! // Don't allow mapped objects or mappings to be pushed!
if ($entity->isSyncing() if ($entity instanceof MappedObjectInterface || $entity instanceof SalesforceMappingInterface) {
|| $entity instanceof MappedObjectInterface return;
|| $entity instanceof SalesforceMappingInterface) { }
// Do not push entities which are synchronizing currently.
if ($entity instanceof SynchronizableInterface && $entity->isSyncing()) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment