-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
BOM: Ensure orders informations are loaded for each line items #10375
BOM: Ensure orders informations are loaded for each line items #10375
Conversation
We display line_items as rows in BOM
This should not be related to any pagination, search or whatever: actually we consolidate line_items with order additional info based on line_items.order.id.
+ update spec as well
d2cb2c1
to
bddd887
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Great work!
Back into EDIT: as it is not reliable also on |
Hey @jibees thanks for fixing this. I guess the previous test was made on a hub with a lot of orders, and the bug becomes unnoticeable at first sight. It's easily spotted if we look at the last page: We see plenty of missing information, and that pagination information is not correct. After staging the PR: We can verify that the pagination information is correct, and that there are no orders missing. I've also tested this PR with the spec on #10383 which considers two orders with plenty of line items. Right now, the spec is failing because the pagination information refers two results - from two orders - although the UI displays plenty of entries, from line items:
Running the spec over this branch passes, so I'd say that shows that your PR fixes the issue 🎉 Thank you! |
Hi! Awesome! 🙌 I don't remember that this problem was here before but I might be wrong 🤔 |
Nice, thanks for reporting that @audez 👍 I can observe it (as of now) in staging-FR, which I believe has not been updated since this fix was merged. I'll stage master and check the behavior again. |
Humm, seems to still affect master: searching for "name" - which in this case can be a customer name, but also a line item: And so on... Ideally these would all appear on the first 15 results, first page. So this seems to be an issue indeed. Not sure if really a bug, perhaps an improvement? It needs an issue either way. Great catch Aude! |
Testing the release v4.2.34 it seems there is still some information missing (sometimes). |
@drummer83 Do you confirm that your find is related to openfoodfoundation/wishlist#402 and not to this one? |
What? Why?
This PR:
change pagination from
orders
toline_items
: we display on that pageline_items
and notorders
, pagination should reflect that.Load orders that are linked to the line_items displayed in the page and not ones that match pagination, search or whatever (we could actually only link one order if this order as at list 15 line_items ; 15 is the default per_page items count)
Closes BOM page is not finding or displaying name, email or order number for some orders #10363
What should we test?
The bug occur if, for the current admin user, there was at least one order with more that one line_items (and therefore pagination was desynchronized). Then the test is pretty simple: go to BOM, and then to page 2. Please ensure you that you could reproduce the bug before staging the PR ;)
Release notes
Changelog Category: User facing changes