-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Trouble saving an Object due to Security Settings on unrelated fields #29
Comments
Sorry for the late reply!!! This should be fixed on the latest release, i encountered it myself last week. Please upgrade to Thanks!!!! |
Hey Rob. I'm on v2.5. This is still an issue it seems. I'm trying to change a single field on an object, but the PATCH request is acting like a PUT request and is trying to change a bunch of unrelated fields on the object. This would be the quick fix as far as I can see... Change: public function writeableAttributes($exclude = [])
{
$fields = array_merge($this->readonly, $exclude);
return Arr::except($this->attributes, $fields);
} To: public function writeableAttributes($exclude = [])
{
$fields = array_merge($this->readonly, $exclude);
return Arr::except($this->getDirty(), $fields);
} For what it's worth. |
I’ll take a look and try these suggestions next week. Thank you for raising. |
Hmm, when I do that, it causes problems for the mass update method. I will need to be thoughtful about how to implement this. |
Aw copy that. I hadn't tested with mass updates. Interesting that it would have an effect on it actually. All good. |
Hi there, just wondering if this was ever resolved, as I have now encountered this issue once introducing This package is working very well for me, however, I now need to get around this issue if I can. |
Thanks for the great package! One issue I ran into and possible solution.
I tried to update the Description field on a Case object.
I received this error message.
Salesforce response error: Client error: ``PATCH https://******.my.salesforce.com/services/data/v47.0/sobjects/Case/5006C000004ZWUGQA4`` resulted in a ``400 Bad Request`` response: [{"message":"Unable to create/update fields: LastModifiedDate, CreatedDate, ContactEmail. Please check the security settings...
The culprit was that I had specified LastModifiedDate, CreatedDate, and ContactEmail in the $columns property on the Case model.
Even though I did not actively try to modify these properties, it looks they are still being passed to Salesforce as part of the patch request.
I'm not an expert but I think you can replace these 2 lines in Model.php:76
with this line in the patch request (to only include the fields that have changed)
Thanks again! This package is helping us a lot.
The text was updated successfully, but these errors were encountered: