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

Many to many associations on versioned entites (specifically order tags) are not really versioned #6231

Open
nickygerritsen opened this issue Jan 14, 2025 · 2 comments

Comments

@nickygerritsen
Copy link
Contributor

nickygerritsen commented Jan 14, 2025

PHP Version: 8.2 | Shopware Version: 6.6.9.0 | Affected area / extension: Platform(Default)


Actual behaviour:

Order has a many to many association with tags through the OrderTagDefinition definition.
That definition has an order version ID (but not it's own version ID).

However, when creating a version of the order, we do not copy the data from the order_tag table, because it is not marked as cascade delete (and I don't think it should?) and thus it is not added as a clone assocation. And because there is no version_id column we also don't add any version query information to the select query.

So:

  • It seems currently order_version_id is not really used in order_tag. Should it?
  • Should order_tag have a version_id column as well?
  • Should data from the order_tag table be copied when creating a new version of an order?

Or are tags on orders not versioned on purpose? Currently if you create an order with tags, create a new version of that order and remove tags from that version, the tags are also gone on the original order.

Expected behaviour:

I expect the version logic of order tags to either use the order version ID or the order version ID to be dropped from the table if it's not used anyway.

How to reproduce:

  • Create an order with tags.
  • Create a new version of that order.
  • Remove a tag from that version.
  • Load the original order version.
  • Inspect that the tag is also gone on that version of the order.
@shopwareBot
Copy link

[public] Shopware automated response: This issue is linked to the internal issue: NEXT-40266

[created from NEXT-40266, comment 533939]

@shopwareBot
Copy link

[public]

Priority changed to: Low

Thank you for your report. After careful consideration, we've concluded that this issue does not require immediate attention or isn't something we can address right now. We prioritize openness and clear communication with our community, so we want to be transparent. We may not resolve all reported issues, and this one might remain unresolved. To stay effective, we periodically clean our backlog, and this issue could be closed in the future.

For now, we'll keep this ticket open to invite further feedback from the community in case we've underestimated its impact and to allow us to revisit it later.

[created from NEXT-40266, comment 533956]

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

2 participants