-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix code standards in orders code, and check payment method name instead of title on get order totals #30468
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
Conversation
claudiosanches
left a comment
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.
Looks good, there's only a minor change pending to remove check for $_POST['_wpnonce'].
claudiosanches
left a comment
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.
Works great now!
|
There's still an error with PHP Unit tests, but seems like just need to rebase with trunk to fix it. Anyway, doesn't seems to be a requirement before merging this PR. |
- Sanitize all input - Escape all output - Verify nonce on save - Verify that all required POST parameters are present on save - Minor fixes (periods at end of comments, function docs, Yodas...)
Also move comment to new line for readability.
The check is already performed in the code that invokes "save".
29a6f42 to
8f3c2f7
Compare
|
📊 Test reports for this pull request have been published and are accessible through the following links:
Latest commit referenced in the reports: Visit the WooCommerce Test Reports homepage to view all published reports. See the FAQs page if you're having problems accessing them. |
|
Hi @Konamiman! FYI I've rebased this with the latest We could also switch places if you'd rather have me fix the remaining issues. Thanks! |
|
Hi @jorgeatorres, yes, let's switch places and I'll review this time. Thank you! |
|
Hi @jorgeatorres, after a second look it seems that all the code style violations are bout hooks not having documentation comments. I don't think it makes sense to add all those in the context of this pull request, so maybe we can merge it as is. |
jorgeatorres
left a comment
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.
Hi @Konamiman!
This looks good to me. I've only requested one tiny change. Once that's addressed, we're good to go.
Thanks!
plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php
Show resolved
Hide resolved
plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php
Show resolved
Hide resolved
Test Results SummaryCommit SHA: 316be4d
To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
51e412c to
f96737e
Compare
jorgeatorres
left a comment
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. Thanks Néstor!
|
Hi @jorgeatorres, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
…ead of title on get order totals (#30468) * Fix code standards errors in class-wc-meta-box-orrder-data.php - Sanitize all input - Escape all output - Verify nonce on save - Verify that all required POST parameters are present on save - Minor fixes (periods at end of comments, function docs, Yodas...) * Check payment method name, not title, on add_order_item_totals_payment_method_row * Remove unnecessary nonce verification in "save" for orders. Also move comment to new line for readability. * Remove unnecessary nonce check in WC_Meta_Box_Order_Data::save The check is already performed in the code that invokes "save". * Add transaction id to payment method string if URL doesn't exist * Minor fix Co-authored-by: Jorge A. Torres <[email protected]>
All Submissions:
Changes proposed in this Pull Request:
Fix code standards errors in order details metabox (class-wc-meta-box-order-data.php)
save.save, throw an exception if not.Check payment method name instead of display title in WC_Order::add_order_item_totals_payment_method_row
This method, used by
get_order_item_totals, now adds a "payment method" row to the returned data only if the payment method name is different fromother(the payment method title was being checked instead, but both are different since #30256 was merged).How to test the changes in this Pull Request:
For the code standards fixes: open an order in the admin area and verify that all the data in the order dettails box is rendered correctly. Do some changes in the order, click "Update" and verify that the changes are saved correctly.
For the change in
get_order_item_totals:You may want to use the email logger plugin to see the email sent.
Other information:
Changelog entry
N/A - It's basically a fix for #30256, which is to be included in the same release.
FOR PR REVIEWER ONLY: