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

OneToOne EntityExtension broken in 6.4.3.0 (Internal Server Error) #2015

Closed
sawden opened this issue Aug 11, 2021 · 3 comments
Closed

OneToOne EntityExtension broken in 6.4.3.0 (Internal Server Error) #2015

sawden opened this issue Aug 11, 2021 · 3 comments
Labels

Comments

@sawden
Copy link
Contributor

sawden commented Aug 11, 2021

PHP Version

7.4.22

Shopware Version

6.4.3.0

Expected behaviour

It should be possible to expand the product with a "OneToOneAssociationField" as described in the documentation.

This error is very critical because none of the plugins that extend the product entity can currently be used.

Actual behaviour

Currently, all plugins that extend the product entity with a "OneToOneAssociationField" lead to a 500 error when saving or editing products in the administration.

An error message appears in the upper corner.
sw6_err

In the developer tools you can see that there is an Internal Server Error.
sw6_err2
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'OTO' in 'field list'

How to reproduce

Create a Plugin that extends the "Product" with a "OneToOneAssociationField" or download/clone my example plugin that reproduce this error.

Github repository here

  • Install the plugin.
  • Open the administration and edit an existing product (add a space in to the name) or try to create a new product.
  • Press "Save"

...Internal Server Error...

@sawden sawden added the Bug label Aug 11, 2021
@shyim
Copy link
Member

shyim commented Aug 11, 2021

Your field is Inherited, you need to use the inheritance updater to add a new column in product table named like your association

@sawden
Copy link
Contributor Author

sawden commented Aug 12, 2021

Thanks, everything works as expected.

Thanks for your work 🙂

@shyim shyim closed this as completed Aug 12, 2021
@sawden
Copy link
Contributor Author

sawden commented Aug 28, 2021

@shyim It seems as if the inheritance for product extensions does not work with a one-to-one relation. 🤔

I've updated the code in my reproduction repository but the extension is not inherited on to the variant products.

I've already tried everything and I'm running out of ideas... 😕

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

No branches or pull requests

2 participants