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

[WooCommerceSubscription] Fixed a fatal error while trying to edit a subscription #2092

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

nurul-umbhiya
Copy link
Contributor

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Getting a fatal error while trying to edit a WooCommerce Subscription under WordPress Admin Dashboard --> WooCommerce --> Subscriptions menu

2023-11-30T08:34:07+00:00 CRITICAL Uncaught Error: Call to a member function get_id() on int in /var/www/html/app/wp-content/plugins/woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php:412
Stack trace:
#0 /var/www/html/app/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php(309): WC_Order_Data_Store_CPT->get_total_tax_refunded()
#1 /var/www/html/app/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(224): WCS_Subscription_Data_Store_CPT->get_total_tax_refunded()
#2 /var/www/html/app/wp-content/plugins/woocommerce/includes/class-wc-order.php(2095): WC_Data_Store->__call()
#3 /var/www/html/app/wp-content/plugins/dokan-lite/includes/Commission.php(331): WC_Order->get_total_tax_refunded()
#4 /var/www/html/app/wp-content/plugins/dokan-lite/includes/Order/functions.php(235): WeDevs\Dokan\Commission->get_earning_by_order()
#5 /var/www/html/app/wp-includes/class-wp-hook.php(326): dokan_sync_insert_order()
#6 /var/www/html/app/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 /var/www/html/app/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /var/www/html/app/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(263): do_action()
#9 /var/www/html/app/wp-includes/class-wp-hook.php(326): WC_Admin_Meta_Boxes->save_meta_boxes()
#10 /var/www/html/app/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#11 /var/www/html/app/wp-includes/plugin.php(517): WP_Hook->do_action()
#12 /var/www/html/app/wp-includes/post.php(4760): do_action()
#13 /var/www/html/app/wp-includes/post.php(4862): wp_insert_post()
#14 /var/www/html/app/wp-admin/includes/post.php(453): wp_update_post()
#15 /var/www/html/app/wp-admin/post.php(227): edit_post()
#16 {main}
  thrown in /var/www/html/app/wp-content/plugins/woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php on line 412

Related Pull Request(s)

  • Full PR Link

Closes

How to test the changes in this Pull Request:

  • Kindly test if commission are being calculated properly for corresponding subscription orders.

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Getting a fatal error while trying to edit a WooCommerce Subscription under WordPress Admin Dashboard --> WooCommerce --> Subscriptions menu
@nurul-umbhiya nurul-umbhiya added Needs: Testing This requires further testing 👍 Dev Review Done labels Nov 30, 2023
@shashwatahalder01 shashwatahalder01 added QA In Progress QA approved This PR is approved by the QA team and removed Needs: Testing This requires further testing QA In Progress labels Dec 5, 2023
@nurul-umbhiya nurul-umbhiya merged commit b644878 into develop Dec 11, 2023
2 checks passed
@mrabbani mrabbani deleted the wc-subscription-fatal-patch-1 branch June 14, 2024 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA approved This PR is approved by the QA team 👍 Dev Review Done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants