Skip to content

New Wordpress object is not pushed to Salesforce if Salesforce user can create but can't edit records #540

@jose-dvm

Description

@jose-dvm

Describe the bug

Hi, I was trying to setup a Leads push and I noticed that when using a Salesforce user who can create Leads but cannot edit them, the plugin doesn't push the new Wordpress record to Salesforce. Adding Edit permission to the user solves this, but it prevents to use a least privileges possible policy and results in a confusing UX.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Fieldmap to push some Wordpress object as Salesforce Leads using a Salesforce user who can create but not edit Leads. Probably Salesforce fields will be displayed as Locked.
  2. Create the Wordpress record
  3. Push won't be performed and a debug log will be created if this is setup

Expected behavior
If the Salesforce user can create records, new Wordpress records should be pushed to Salesforce.

Screenshots

Screenshot of ignored push log:

imagen

Environment (please complete the following information):

  • WordPress Version: 6.4.5
  • PHP Version 7.4.33

Additional context

I think this is due to considering as locked / read-only fields those who are not updateable, even when they are createable.
See this in Fiedmap page and the next one used in push class:

if ( false === $salesforce_field['updateable'] ) {

if ( 1 !== (int) $fieldmap['salesforce_field']['updateable'] ) {

Metadata

Metadata

Labels

bugSomething isn't workingneeds to be replicatedWe need to see this issue again to know how it's happening

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions