-
Notifications
You must be signed in to change notification settings - Fork 69
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 order and subscription numbers on transaction list report #1556
Conversation
The order.value was being incorrectly assigned. Since it was not used outside of the CSV download functionality we didn't notice it until the table export was implemented. This commit fixes it, fixing the report download as well.
The subscriptions.value was being incorrectly assigned. Since it was not used outside of the CSV download functionality we didn't notice it until the table export was implemented. This commit fixes it, fixing the report download as well.
cc @kalessil as you're handling this release 😄 |
Thanks for the ping and quick bug-fix @luizreis, I'll review and test the PR today. |
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.
LGTM,
] ); | ||
wcpaySettings.isSubscriptionsActive && orderSubscriptions | ||
? orderSubscriptions.map( ( subscription, i, all ) => [ | ||
<OrderLink key={ i } order={ subscription } />, |
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.
First, sorry for the drive-by review. Do we have a better choice than to use the index for the key
? If the order changes things can get messy behind the scenes.
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.
No worries at all, thank you for bringing this to our attention! We have this pattern being used in some other parts of the code, though it's not that common, so I created #1789 to track it and fix it in all of the places it's used.
Fixes #1548
Changes proposed in this Pull Request
This PR fixes the order and subscription values when generating the transaction list, to fix the CSV download report.
I haven't added a changelog entry as this fix only impacts the transaction list download, which hasn't been shipped yet.
Testing instructions
Make sure the transaction list is rendered correctly and no console errors are thrown when rendering it.
Missing order test:
add_order_info_to_object
in./includes/wc-payment-api/class-wc-payments-api-client.php:1119
to simulate an order not found response