Skip to content

Regression "woocommerce-order-items" postbox gets hidden when "dokan_commission_box" is hidden #2499

Open
@oliviertassinari

Description

@oliviertassinari

Bug Description

This logic can't work:

<div id="woocommerce-order-items" class="postbox" style='border: none'>

WordPress hides blocks using this logic:

hidden = $( '.postbox' ).filter( ':hidden' ).map( function() { return this.id; } ).get().join( ',' );

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/

An ancestor element is hidden, so the element is not shown on the page

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-18226349

Step To Reproduce

Screen.Recording.2025-01-05.at.16.46.24.mov

Additional Information

There has been a lot of regressions lately:

and now this one. Please do something about it, we can't sustain this pace.

Environment (please complete the following information)

1. Dokan Version: v3.14.4

cc @hasdfa for awareness, in case someone complains about this bug internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions