Warning when an entity is pushed to Salesforce: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated

Created on 25 September 2024, 4 months ago

Problem/Motivation

When I push an entity through the salesforce push UI, the following warning appears:

addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated

Steps to reproduce

  1. Create a Salesforce mapping with Salesforce for a specific entity. Activate queue option.
  2. Create an entity related to the configuration created before.
  3. Go to the 'Salesforce' tab.
  4. Push it.

After this, the warning appears.

It only happens the first time, when the entity is not pushed yet to salesforce.

Proposed resolution

Error comes from UniqueFieldsConstraintValidator, which prevents creating duplicated entities according to the unique fields configured. The warning occurs because the query to find entities with the same unique fields is filtering by NULL values.

Proposed resolution is to, instead of passing null, pass an empty string.

πŸ› Bug report
Status

Active

Version

5.1

Component

salesforce.module

Created by

πŸ‡ͺπŸ‡ΈSpain omarlopesino

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

Comments & Activities

Production build 0.71.5 2024