-
Notifications
You must be signed in to change notification settings - Fork 206
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
Regression "woocommerce-order-items" postbox gets hidden when "dokan_commission_box" is hidden #2499
Comments
The issue you are experiencing appears to be site-specific, as we are unable to replicate it on our local environments. We recommend reaching out through our official support channel by creating a support ticket from your Dokan.co account or submitting the form on our "Contact Us" page. Thank you! |
@TanvirHasan19 We have another user complaining: https://wordpress.org/support/topic/edit-order-product-details-no-longer-possible/. I could reproduce the problem on a from-scratch installation on http://dokan-bug-2499.infy.uk/?i=1 (I can provide the credentials if needed). The reproduction steps are:
To restore the box visibility, there are a few ways possible that I have worked (from the UI down to the backend):
curl 'http://dokan-bug-2499.infy.uk/wp-admin/admin-ajax.php' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7,he;q=0.6,bg;q=0.5,gu;q=0.4' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Cookie:
-H 'Origin: http://dokan-bug-2499.infy.uk' \
-H 'Pragma: no-cache' \
-H 'Referer: http://dokan-bug-2499.infy.uk/wp-admin/admin.php?page=wc-orders&action=edit&id=28' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36' \
-H 'X-Requested-With: XMLHttpRequest' \
--data-raw 'action=closed-postboxes&closed=&hidden=&closedpostboxesnonce=9b3f6a8bbe&page=woocommerce_page_wc-orders' \
--insecure
|
Bug Description
This logic can't work:
dokan/templates/orders/commission-meta-box-html.php
Line 42 in 8e3b23a
WordPress hides blocks using this logic:
Souce: https://github.com/WordPress/WordPress/blob/aa87f886780f31edc1f9148ed16cf36046d7f9bf/wp-admin/js/postbox.js#L462
And because
:hidden
match is broad: https://api.jquery.com/hidden-selector/it means that hiding "dokan_commission_box" also sets "woocommerce-order-items" as hidden
See the structure of the DOM:
Screen.Recording.2025-01-05.at.16.42.53.mov
It gets even worse, because there are two
woocommerce-order-items
on the page, once one is hidden and the page is released, the logic sets the two as hidden, and it's impossible to show back without sending custom cURL requests or updating the database: https://wordpress.org/support/topic/edit-order-product-details-no-longer-possible/#post-18226349Step To Reproduce
Screen.Recording.2025-01-05.at.16.46.24.mov
Additional Information
There has been a lot of regressions lately:
dokan-lite/includes/Commission/Settings/OrderItem.php:74
#2491dokan-lite/includes/Commission.php:267
#2486and now this one. Please do something about it, we can't sustain this pace.
Environment (please complete the following information)
cc @hasdfa for awareness, in case someone complains about this bug internally.
The text was updated successfully, but these errors were encountered: