Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

[Bug]: On PHP8, deprecation warning occurs when trim() function is called with a null parameter #542

@lasso

Description

@lasso

Expected behavior

trim() function should not be called with null parameter.

Actual behavior

In src/DuplicatesIndex/DefaultMariaDbDuplicatesIndex.php, line 699 the trim() function gets called without ensuring that the value is not null. Before PHP8 this was not a problem, put in PHP8 this raises a deprecation warning:

<b>Deprecated</b>: trim(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/var/www/pimcore/vendor/pimcore/customer-management-framework-bundle/src/Dupl
icatesIndex/DefaultMariaDbDuplicatesIndex.php</b> on line <b>699</b><br />

If error_reporting is set to E_ALL, this will mess up the response sent to the client.

Steps to reproduce

Sorry, even though I was a PHP developer a long time ago, I'm not a regular Pimcore developer/user. While helping a customer, I found this error tainting a JSON response and decided to find out where it came from. I guess a prerequisite would be that at least one of the fields in the index must be null, but beyond that I don't have any more information.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Affected capability

    None yet

    Platform Version

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions