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

wp_enqueue_media called too early #362

Closed
madeincosmos opened this issue Jan 2, 2018 · 14 comments
Closed

wp_enqueue_media called too early #362

madeincosmos opened this issue Jan 2, 2018 · 14 comments
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@madeincosmos
Copy link
Contributor

Affected tickets

876228-zen

Quoting the ticket:

In the 'Pyapal Express Checkout', there is a call to wp_enqueue_media() in /plugins/woocommerce-gateway-paypal-express-checkout/includes/abstractsabstract-wc-gateway-ppec.php.
This call is done in an incorrect order. This function should be called from the 'admin_enqueue_scripts' action hook, or later (see wordpress documentation).

Because of this, I cannot edit the featured image in my products. It is not causing a problem if I have this plugin activated only, but in combination with other plugins it is causing the problem described.
Please correct in alignment with the wordpress documentation.

Indeed, the method is called in gateway constructor:

https://github.com/woocommerce/woocommerce-gateway-paypal-express-checkout/blob/master/includes/abstracts/abstract-wc-gateway-ppec.php#L69

@mattyza mattyza added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug. labels Jan 2, 2018
@mikkamp
Copy link

mikkamp commented Jan 10, 2018

Another ticket where this same conflict was reported: 883255-zen

It does seem that the wp_enqueue_media is being called too early. In WooCommerce it is loaded after the correct hook, see: https://github.com/woocommerce/woocommerce/blob/3.2.6/includes/admin/class-wc-admin-assets.php#L27

Also uploading of images for PPEC is only done on the settings page: page=wc-settings&tab=checkout&section=ppec_paypal
So it would probably be better to add some conditionals so it's not loaded on every admin page.

@vyskoczilova
Copy link

@pharmak0n
Copy link

Same problem here, I cannot set thumbnails. When I deactivate the plugin thumbnails starts working again. Please fix it, it's impossible to work with this problem

@madeincosmos
Copy link
Contributor Author

Also reported in 906466-zen. When used in combination with WooCommerce POS Pro, product feature images can't be set. Bumping priority to high as it's affecting more customers.

@madeincosmos madeincosmos added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. and removed priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. labels Jan 18, 2018
@stefanduerrenberger
Copy link

Same problem in combination with the WooCommerce Pay for Payment plugin.

@madeincosmos
Copy link
Contributor Author

One more user reporting this in 934426-zen.

@yukikatayama
Copy link

Checking in to see if there's any movement? Thanks!

@laurendavissmith
Copy link
Contributor

laurendavissmith commented Feb 27, 2018

@yukikatayama @madeincosmos We have an open PR for it I just need to test it.
PR: #392

Also looks like #376 is a dupe of this one

@amandasjackson
Copy link

@bor0 just wondering about a milestone, thanks

@bor0
Copy link
Member

bor0 commented Mar 6, 2018

Fixed by #392.

@bor0 bor0 closed this as completed Mar 6, 2018
@Luminus
Copy link

Luminus commented Mar 14, 2018

@bor0 do we have an ETA for a new release or a milestone for this to be added to? I see that the fix has been merged to master but a new version is yet to be deployed.

@zwiesman31
Copy link

@bor0: Following up with Luminus' comment. Is there a potential ETA for this yet release yet?

@bor0
Copy link
Member

bor0 commented Mar 28, 2018

I released 1.5.3 today which contains this fix.

@Luminus
Copy link

Luminus commented Mar 28, 2018

Thanks @bor0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests