• Resolved editpostok

    (@editpostok)


    Hi,

    Media upload functionality of this plugin seems to cause a conflict with the post/pages feat. image media library popup.

    Once this plugin is enabled the feat. images can’t be added or the available images are not visible in the media library.

    Using PHP 8.0 and clean install with WooCommerce

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ndeet

    (@ndeet)

    Hi @editpostok,

    do you get any errors in the PHP logs or Javascript console? I now tried to reproduce on an existing and a fresh install with only woocommerce and the plugin on PHP 8.1 and there were no problems. I can check on Monday with PHP 8.0 but I don’t think it will be different.

    You said fresh install, did you only install WooCommerce and BTCPay Server V2 plugin and nothing else?

    Can you go to WooCommerce status page and send me more information of your setup so I can try to reproduce?

    Thread Starter editpostok

    (@editpostok)

    Hi, thanks for your reply.

    I tried to recreate the issue again, but now assigning the images to the post does work.

    However, the media library on the post/pages edit screens is still affected, because it will show an extra image spot, which also happened when the feat. images didn’t work. https://ibb.co/k1KHCSk

    The problem must be that the plugin’s wp media library js is loaded throughout the whole admin area instead of the plugin’s settings page only.

    /assets/js/gatewayIconMedia.js

    This is also loaded everywhere: /assets/js/apiKeyRedirect.js

    Best regards

    Plugin Author ndeet

    (@ndeet)

    Hi, very strange that this happens. The JS itself only loads the media library object after click on a button that only exists on the BTCPay payment gateway config form. Also wp_enqueue_media() does not load if it is already loaded. Not sure how this ghost thumbnail can be triggered then but there seems to be something going on.

    Checking the wp.media JS docs, the best practice is to not load it at all on other pages which makes perfect sense (and what you also suggested). I now refactored the code to only load on wc payment settings page. You find the fix in v0.2.5, let me know if it works for you.

    • This reply was modified 3 years ago by ndeet.
    Thread Starter editpostok

    (@editpostok)

    Thank you, the issue is gone.

    I just checked and it seems like wp_enqueue_media() was being called too early in the last version.

    It’s all good now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Media library conflict’ is closed to new replies.