Skip to content

Conversation

@kaushikasomaiya
Copy link
Contributor

@kaushikasomaiya kaushikasomaiya commented Nov 18, 2022

Fix for #33228

I spent some time troubleshooting the root cause of this issue.

Appears that we're using the following filters at different places in WooCommerce:

remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

// Code Stuff

add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

comments_clauses filter is causing issues in the line here:

$comment_count = get_comment_count( $order->get_id() );

Removing the filter before calling get_comment_count fixes the Tooltip issue.

Could anyone please review this PR, adjust code if applicable, and merge if it is good?

Result after applying the fix:

img

@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Nov 18, 2022
@peterfabian peterfabian requested review from a team and Konamiman and removed request for a team November 18, 2022 11:57
@peterfabian
Copy link
Contributor

Can you please make sure this works both with HPOS on and off? I think you only changed it in one place and we need to check both now as the code handling it is (most likely) different.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2022

Test Results Summary

Commit SHA: a1d27fb

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26000202620m 50s
E2E Tests000000NaNm NaNs

⚠️ Warning

Please address the following issues prior to merging this pull request:
  • INCOMPLETE E2E TEST RUN. We have a total of 192 E2E tests, but only 0 were executed. Note that in CI, E2E tests automatically end when they encounter too many failures.

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@kaushikasomaiya
Copy link
Contributor Author

Can you please make sure this works both with HPOS on and off? I think you only changed it in one place and we need to check both now as the code handling it is (most likely) different.

Thanks @peterfabian - I activated HPOS feature: https://d.pr/i/4Aks14

But my code change still works - does that mean comment/order notes storage is still not a part of HPOS tables? Though it is mentioned here that order notes will be stored separately: https://developer.woocommerce.com/2022/01/17/the-plan-for-the-woocommerce-custom-order-table/

But I couldn't find wp_wc_order_notes and wp_wc_order_notes_meta being created.

@Konamiman
Copy link
Contributor

Hi @kaushikasomaiya, the ListTable.php file you modified was actually introduced for HPOS so it's all ok. I'm approving this, thanks.

@Konamiman Konamiman merged commit 102fabb into trunk Nov 23, 2022
@Konamiman Konamiman deleted the fix/fix-tooltip-in-admin-order-table branch November 23, 2022 11:06
@github-actions github-actions bot added this to the 7.3.0 milestone Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants