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

[Bug]: "" is interpreted as "--EMPTY--" in transformation pipeline #443

Open
cancan101 opened this issue Dec 12, 2024 · 2 comments
Open

Comments

@cancan101
Copy link
Contributor

cancan101 commented Dec 12, 2024

Expected behavior

Empty string gets stored in the DB as an empty string.

Actual behavior

Empty string gets stored in DB as null. This causes issues with the resolver as it can't find the existing object (I assume it tries to do '' = null in the filter):
Image

Steps to reproduce

  1. Data source should have a field whose value is ''
  2. Define element look up based on that field
  3. Assing that field in mapping
  4. Run importer twice. Once to create the object and then again to see look up failure.

Related: #211

@cancan101 cancan101 added the Bug label Dec 12, 2024
@cancan101
Copy link
Contributor Author

cancan101 commented Dec 13, 2024

Elaborating on the issue here:

  1. Some combination of Pimcore / Symfony / Doctrine look to be storing the empty string as null in the database
  2. When the importer runs again and does a lookup to check if the object exists, it queries the database for empty string and does not find a match (since it is stored as null).
  3. The importer then tries to create a new object which fails since the object does already exist. (unique constraint on key which is made of that attribute)

Any fix here? Ideally we can get empty string to store as empty string. As a short term fix, the look up should correctly handle looking up empty string as is null or = ''.

n.b. that db unique constraints don't include nulls so multiple entries for empty string can be stored.

Not sure if this was changed in: pimcore/pimcore#13963
CC @fashxp

Copy link

github-actions bot commented Jan 3, 2025

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant