WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#39615 new defect (bug)

The JS Bootstrapping For Media Handling Breaks Due To Validation Service

Reported by: rjc430404 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.1
Component: Media Keywords: reporter-feedback
Focuses: Cc:

Description

There is an issue for me on 4.7.1 when I go to interact with anything media related. Your validation service isn't bound correctly so it kills the script and nothing get executed.

Attached is the out put of chrome dev tools, the block in question, and the position of the block inside of the dev tools prettified output.

For now I've rolled back to WP 4.7 as a work around.

Plugins I've got installed:

ACF Pro - 5.5.3 Duplicator - 1.1.26 S3 Uploads (Human Made Limited) - 2.0.0-beta2 Yoast SEO - 4.1 My Custom Plugin

Let me know if you need anything else from me.

Attachments (3)

Screen Shot 2017-01-17 at 11.19.30 AM.png (86.5 KB) - added by rjc430404 17 months ago.
JS Stack Trace
Screen Shot 2017-01-17 at 11.19.51 AM.png (58.1 KB) - added by rjc430404 17 months ago.
Code block
Screen Shot 2017-01-17 at 11.20.07 AM.png (5.2 KB) - added by rjc430404 17 months ago.
Col And Line numbers

Download all attachments as: .zip

Change History (9)

@rjc430404
17 months ago

Col And Line numbers

#1 @adamsilverstein
17 months ago

@rjc430404 thanks for the bug report. I was unable to reproduce this issue.

I am able to upload and edit images fine under a stock 4.7.1 install. Can you try temporarily disabling your plugins and switching to the default theme to see if the issue goes away?

#2 @adamsilverstein
17 months ago

  • Keywords reporter-feedback added

#3 @rjc430404
17 months ago

@adamsilverstein I've done as requested, but the issue persists with everything disabled. I tested on chrome.

Would a clone of my WP install be beneficial?

#4 @adamsilverstein
17 months ago

@rjc430404 Searching the WordPress core codebase, I can't find _any_ reference to "ValidationService". Can you verify you are running the twentyseventeen theme, and also check that you don't have any "MU" plugins installed?

Can you tell in the inspector what file the error occurs in? You may need enable script debug to see where the error is (define( 'SCRIPT_DEBUG', true );) I still suspect this is not a WordPress core issue.

#5 @rogerlos
17 months ago

FWIW, the code block above

wp.Uploader && ValidationService.isEmpty().value() && this.observe(wp.Uploader.queue)},

is in /wp-includes/js/media-models.min.js at column 11044 (version 4.7.1), though not verbatim (spaces added to wrap nicely):

wp.Uploader && _(this.args).chain().keys().difference(c).isEmpty().value() 
&& this.observe(wp.Uploader.queue)},

I know nothing of how core concatenates, substitutes or otherwise allows other plugins to insert values here, but I assume what @rjc430404 has encountered is either because the WP core code can be filtered to allow the insertion of something like "ValidationService" or because something naughty has happened to the install.

The unminified code is at line 1169 of /wp-includes/js/media-models.js:

// Observe the central `wp.Uploader.queue` collection to watch for
// new matches for the query.
//
// Only observe when a limited number of query args are set. There
// are no filters for other properties, so observing will result in
// false positives in those queries.
allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent' ];
if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) {
    this.observe( wp.Uploader.queue );
}

Again, not an expert at all, but a quick google shows the vast majority of "ValidationService" hits being related to angular.js. Is there a chance your theme or server are running angular?

My itchy spot says this seems like a hosting or machine-specific install of WP which is doing some undoubtedly lovely angular stuff.

Please delete me if I'm barking up the wrong tree here.

#6 @adamsilverstein
17 months ago

@rogerlos ah, thanks for pointing out the minified file use, I was only looking thru the source code.

I am going to dig into this a bit further.

@rjc430404 can you describe the exact steps to reproduce the error? Anything unusual about your media library that might be relevant? Also, can you try adding define('SCRIPT_DEBUG', true ); to your wp-config.php file so you can see the error in the unminimized js files? Thanks

Last edited 17 months ago by adamsilverstein (previous) (diff)
Note: See TracTickets for help on using tickets.