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

fix: backend order detail position, missing Article Detail id on add … #2635

Merged

Conversation

Dominikrt
Copy link
Contributor

…or update position

1. Why is this change necessary?

Shopware Backend Order Position Module don't save articleDetailID from later added/updated article.

This cause issues with Doctrine, trying to get the articleDetail from orderPosition.

+---+-------+---------+------------------+---------------+
|id |orderID|articleID|articleordernumber|articleDetailID|
+---+-------+---------+------------------+---------------+
|208|59     |78       |SW10079           |141            |
|209|59     |0        |SHIPPINGDISCOUNT  |null           |
|210|59     |215      |SW10213.3         |null           |
|212|59     |113      |SW10114           |null           |
+---+-------+---------+------------------+---------------+

Here a query result with the bug from the s_order_details table with 'SW10213.3' and 'SW10114' as later added position.

+---+-------+---------+------------------+---------------+
|id |orderID|articleID|articleordernumber|articleDetailID|
+---+-------+---------+------------------+---------------+
|208|59     |78       |SW10079           |141            |
|209|59     |0        |SHIPPINGDISCOUNT  |null           |
|210|59     |215      |SW10213.3         |759            |
|212|59     |113      |SW10114           |178            |
+---+-------+---------+------------------+---------------+

Here the same query with the fix

2. What does this change do, exactly?

Later added/updated Positions get saved with articleDetailID

3. Describe each step to reproduce the issue or behaviour.

Open a order in Backend and add a position

4. Please link to the relevant issues (if any).

5. Which documentation changes (if any) need to be made because of this PR?

6. Checklist

  • I have written tests and verified that they fail without my change
  • I have squashed any insignificant commits
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

Copy link

Warnings
⚠️ The Pull Request doesn't contain any changes to the Upgrade file

@mitelg
Copy link
Contributor

mitelg commented Mar 18, 2024

hey @Dominikrt

thanks for your contribution 👍

Would you mind extending the following test, to ensure the correct behaviour? OrderTest

@Dominikrt Dominikrt force-pushed the fix-backend-order-position-article-detail-id branch 2 times, most recently from 1b9ba63 to 6c184b0 Compare March 23, 2024 14:21
@Dominikrt
Copy link
Contributor Author

Hi @mitelg,
thanks for the feedback, I add a test to check the relation.

@mitelg
Copy link
Contributor

mitelg commented Mar 23, 2024

hey @Dominikrt

your changes looks good! thank you very much for that 👍

Unfortunately it seems that we have problems with the pipeline. So we need to check that first 🙈 sorry for the inconvenience here. Once it is up again and green, your change is ready to merge 💪

@mitelg
Copy link
Contributor

mitelg commented Apr 2, 2024

hey @Dominikrt

after a rebase the CI should work again

@mitelg mitelg added the review label Apr 2, 2024
@Dominikrt Dominikrt force-pushed the fix-backend-order-position-article-detail-id branch from 6c184b0 to 14dea4d Compare April 2, 2024 19:03
@Dominikrt
Copy link
Contributor Author

Hi @mitelg,
thank you, it looks better now with the tests

@mitelg mitelg force-pushed the fix-backend-order-position-article-detail-id branch from 14dea4d to fb0cbae Compare April 3, 2024 08:18
@mitelg mitelg merged commit e344aa1 into shopware5:5.7 Apr 3, 2024
4 checks passed
@mitelg
Copy link
Contributor

mitelg commented Apr 3, 2024

thanks for your contribution @Dominikrt 👍🎉💙

@Dominikrt Dominikrt deleted the fix-backend-order-position-article-detail-id branch May 16, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants