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

Add prefix to the checksum field to prevent mapping conflicts with other fields of the same name in Pimcore classes #280

Open
wants to merge 1 commit into
base: 6.x
Choose a base branch
from

Conversation

DanielLaranjeira063
Copy link

Currently if you add a field called "checksum" to a Pimcore dataobject class, this will throw the following mapping error:

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"object mapping for [checksum] tried to parse field [checksum] as object, but found a concrete value"}],"type":"mapper_parsing_exception","reason":"object mapping for [checksum] tried to parse field [checksum] as object, but found a concrete value"},"status":400}
This is because the bundle itself has a checksum field being added in with the dataobject data and results in a mapping conflict with the Pimcore class field.
To fix this, I have used the bundle prefix configured by the user to name this checksum field. This prevents such conflicts.

Just like the bundle's database tables, it is always good practice to prefix this kind of things, to prevent conflicts with user developments and customization or even other bundles as well.

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

Successfully merging this pull request may close these issues.

1 participant