Disallowing a pull in PULL_PRESAVE does not stop the entity from being created.

Created on 12 September 2024, 3 months ago

Problem/Motivation

The PULL_PRESAVE description says: "Final chance for subscribers to prevent creation or alter a Drupal entity
during pull."
I have found this is not the case and that disallowing a pull does not stop the entity from being created.
It is clear why this happens from L585-595 of Drupal\salesforce_mapping\Entity\MappedObject.php

Steps to reproduce

  • Trigger a pull on a new item.
  • Interrupt the pull in the PULL_PRESAVE event using $event->disallowPull().
  • The entity will be created even though the pull is disallowed.
  • Proposed resolution

    I have made a patch that will check if the pull is disallowed, and if so it will not save the entity or the mapped_object.

    Remaining tasks

    Review and test

🐛 Bug report
Status

Active

Version

5.1

Component

salesforce_mapping.module

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024