Support

Account

Home Forums Bug Reports Post Object showing as [object Object] in select

Solved

Post Object showing as [object Object] in select

  • hy,
    after updating to 5.10 i saw that selected post objects are shown like on the screenshot. the functionality is ok. i can select other values and in the dropdown they appear fine. but after selecting, the selected is again shown as [object Object]. the mousover also shows the title of the object correct.

    i have already updated wordpress to 5.8 and cleared all caches in my browser.

    antoher thing to note: the search-hint in the dropdown is shown with readable “…” in the end, so i guess that there may be only a small javascript-bug for displaying the select-library?

    is anyone else seeing this in the same way?
    thank you for your feedback!

  • Hey @matthias-wagnerfalkemedia-at,

    Thanks for the report, we did make changes in 5.10 that could potentially cause this, but we’ve been unable to reproduce it locally – it could be caused by the browser loading a cached or old version of the acf-input.js file though.

    Are you able to clear the browser cache and see if it’s still happening? Alternatively, if you could send us your field group export to [email protected], I’ll pick this up with you there and see if we can figure this out.

    If you’ve go the issue happening on a publicly accessible site you’re able to grant us access too, even better.

    Thanks for your help!

  • hy,

    thank you for your quick reply! i cleared browser cache one more and accessed the site via a fresh browser as well, but that does not make any changes :/

    i am not sure if it may have something to do with woocommerce installed and enabled in this site. because i find this line:
    <link rel='stylesheet' id='select2-css' href='https://www.rinnhofer.info/wp2018/wp-content/plugins/advanced-custom-fields-pro/assets/inc/select2/4/select2.min.css?falkeTS=61277bd691e4f2021' media='all' />
    which seems fine.

    but i can not find a line with select2-js pointing to a js-file inside acf.

    but i can find a line:
    <script src='https://www.rinnhofer.info/wp2018/wp-content/plugins/woocommerce/assets/js/select2/select2.full.min.js?falkeTS=61277bd691e4f2021' id='select2-js'></script> which may be have the same file-handle and use a different version inside woocommerce?

    matt

  • I have the ‘Classic Editor’ plugin installed. If I use the classic editor I see the same issue of [object Object] . However, if I switch to the modern editor Gutenberg then it works fine.

    Don’t know if that’s of any help in diagnosing the issue.

  • hy,
    in our case we do not have “classic editor” or any other plugin like that installed. the site uses block editor and elementor.

    but i have another addition: even when trying to generate a new field group with a “post object” and using the post type filter (which uses select2 as well) the problem occurs.
    so it is not only in the posts and options pages, but also in the acf admin area.

    thank you again for your help 🙂
    matt

  • Hey @matthias-wagnerfalkemedia-at,

    You are right that this is a WooCommerce conflict. They install a different version of select2 called selectWoo, and it has an issue with rendering templates: https://github.com/woocommerce/selectWoo/issues/39

    We’ve got a workaround in testing right now though, and we should have a patch out for this shortly! I’ll let you know once it’s available.

  • Hey @matthias-wagnerfalkemedia-at,

    ACF 5.10.1 has just been released. Could you confirm this solves the issue for you please?

  • great! thank you for your incredibly fast support 🙂

  • Hey,
    Seems like this bug still occurs with latest WC version.

    Advanced Custom Fields PRO 5.12
    WooCommerce 6.3.1 (still using their SelectWoo stuff…)

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.