Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jose-dvm opened this issue Sep 3, 2024 · 1 comment
Labels
bug Something isn't working needs to be replicated We need to see this issue again to know how it's happening

Comments

@jose-dvm
Copy link

jose-dvm commented Sep 3, 2024

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'] ) {

@jonathanstegall
Copy link
Member

That is interesting. I'm not sure if that is the reason, but it's possible. No one is currently working on this plugin, but if there is a fix, it could be possible to implement. Do you have a sense of whether the Salesforce API has a method for detecting whether a field is createable?

@jonathanstegall jonathanstegall added bug Something isn't working needs to be replicated We need to see this issue again to know how it's happening labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs to be replicated We need to see this issue again to know how it's happening
Projects
None yet
Development

No branches or pull requests

2 participants