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

Bug - woocommerce product_variation post type - error in editor #94

Open
katoen opened this issue Dec 5, 2024 · 3 comments
Open

Bug - woocommerce product_variation post type - error in editor #94

katoen opened this issue Dec 5, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@katoen
Copy link

katoen commented Dec 5, 2024

I experience an issue when attempting to use the custom post type product_variation registered by the WooCommerce plugin. While the post type can be selected in the UI, selecting it causes the AQL sidebar to disappear, and the block displays the error:
This block has encountered an error and cannot be previewed.

The query loads correctly on the front-end of the site.
This issue does not occur when using the native Query Loop block.

Note: I enabled the product_variations post type in the UI using the following snippet:

add_action('register_post_type_args', function ($args, $postType) {
    if ($postType !== 'product_variation'){
        return $args;
    }

    $args['show_in_rest'] = true;
    $args['public'] = true;

    return $args;
}, 99, 2);

Wordpress 6.7.1
Plugins:
Advanced query loop 4.0 (but issue existed on 3.2 as well)
Woocommerce 9.4.3

@ryanwelcher ryanwelcher added the bug Something isn't working label Dec 5, 2024
@ryanwelcher ryanwelcher self-assigned this Dec 5, 2024
@ryanwelcher
Copy link
Owner

ryanwelcher commented Dec 5, 2024

Sorry you're running into this!

Can you send me:

  • The output from the console
  • Where you are using AQL? (template or page content)
  • The settings you have for AQL

@katoen
Copy link
Author

katoen commented Dec 5, 2024

Thank you for the quick reply!

Console:

afbeelding
afbeelding
afbeelding

21:39:18.967 TypeError: e.title is undefined
    suggestions https://deft-gentoo-ceef8c.instawp.xyz/wp-content/plugins/advanced-query-loop/build/variations.js?ver=a271f7ee77c4f659a1a8:1
    U https://deft-gentoo-ceef8c.instawp.xyz/wp-content/plugins/advanced-query-loop/build/variations.js?ver=a271f7ee77c4f659a1a8:1
    ht https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    vr https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Qs https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    wl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    bl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    yl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    il https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    fl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Nn https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    ul https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    ul https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    al https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Pt https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    zt https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    s https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    c https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    n https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    n https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    resume https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    batch https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    batch https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    yn https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/core-data.min.js?ver=8224153d27ea1b378c5a:2
    k https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    a Redux
    U https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    D https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    s https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    setTimeout handler*s https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    i https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    m https://deft-gentoo-ceef8c.instawp.xyz/wp-content/plugins/advanced-query-loop/build/variations.js?ver=a271f7ee77c4f659a1a8:1
    m https://deft-gentoo-ceef8c.instawp.xyz/wp-content/plugins/advanced-query-loop/build/variations.js?ver=a271f7ee77c4f659a1a8:1
    p https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    __unstableMarkListeningStores https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    a https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:2
    p https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    Je https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    Qe https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    Ye https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/data.min.js?ver=7c62e39de0308c73d50c:9
    U https://deft-gentoo-ceef8c.instawp.xyz/wp-content/plugins/advanced-query-loop/build/variations.js?ver=a271f7ee77c4f659a1a8:1
    ht https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    vr https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Qs https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    wl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    bl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    yl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    fl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Nn https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    pl https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    V https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    Je https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    pe https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
    fe https://deft-gentoo-ceef8c.instawp.xyz/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.3.1:10
  • Happens on template and pages
  • Settings: not sure what you mean by this. The AQL settings in the block editor right panel? Nothing changed expect for the post type selection.

I've setup a test site, if you want a quick way to check > magic login (site expires in 3hours)

@ryanwelcher
Copy link
Owner

Thanks for sending that over. It look like the product_variations do not support the Title property which is causing another component ( the Post Curation one ) to fail because it keys off of the titles to search posts for listing.

I'll get a fix together for this ASAP. Thanks for opening the issue!

@ryanwelcher ryanwelcher added this to the 4.0.1 milestone Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants