Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
When you get that blank page does your web server’s error indicate why you’re getting a blank page? That’s normally an indication that PHP took a dive and generated a 500 error.
This appeared as closed so I created another topic, sorry for that.
We include this in our theme options : wp_enqueue_media();, which cause a js error : Uncaught TypeError: Cannot read property ‘open’ of undefined on this line : a(document).ready(function(){wp.media&&wp.media({frame:”manage”,container:a(“#wpbody-content > .wrap”)}).open() .
As far as I understand this is a wordpress issue right ?
Nope, it’s your code.
#cwp_container is set to display:none, and so is the container’s inline style.
I have no idea how it ever worked, but as soon as I removed those lines, it was fine.
https://plugins.trac.wordpress.org/browser/wp-product-review/trunk/admin/layout/css/main_page.css#L1010
https://plugins.trac.wordpress.org/browser/wp-product-review/trunk/admin/layout/main_page.php#L1
That’s telling it not to display.
You’re enqueuing wp-admin/js/media.js
on your settings page: https://plugins.trac.wordpress.org/browser/wp-product-review/trunk/admin/inc/render.php#L175
This file is only used on the Media Library (wp-admin/upload.php). Is there a reason for this or just an error in your condition?
What about:
if ( $file == "media" ) {
wp_enqueue_media();
} else {
wp_enqueue_script( $file ) ;
}
Hi guys,
Thanks for help!
@ipstenu is not an error on our side, #cwp_container is set to display:none but we display it from js, because of the js error it doesn’t display .
@dominik yes, on the settings page we do : wp_enqueue_media() and we do that so we can use media upload in the admin panel.
I know that we can improve the logic and fix this, but updating 10+ plugins/themes that doesn’t have an update script included will be really annoying for our us/our clients, I am also afraid about theme review team that has around 1 month delay for some reviews.
This issue happends only in WordPress 4.0, in the previous versions of WP everything was fine ( doesn’t suppose to have some sort of back-ward compatibility ? ).
on the settings page we do : wp_enqueue_media() and we do that so we can use media upload in the admin panel
That’s totally fine. But enqueuing the media script is a bug in your code.
Ok Dominik.. I understand your point I don’t really understand why this worked for more than 1 year and 5 wp versions and now just stopped.
IF there is no plan to change that as it was in 3.9 for example, I will start working on replacing the logic
For the record: I see the JS error, but don’t have blank screen on a clean install with WP Product Review.
THanks for letting me know, for me still doesn’t work with : 4.0-beta2-20140729 ( wp is not clean, but all plugins are deactivated )