Make WordPress Core

Opened 8 years ago

Closed 22 months ago

#39615 closed defect (bug) (worksforme)

The JS Bootstrapping For Media Handling Breaks Due To Validation Service

Reported by: rjc430404's profile rjc430404 Owned by:
Milestone: 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 8 years ago.
JS Stack Trace
Screen Shot 2017-01-17 at 11.19.51 AM.png (58.1 KB) - added by rjc430404 8 years ago.
Code block
Screen Shot 2017-01-17 at 11.20.07 AM.png (5.2 KB) - added by rjc430404 8 years ago.
Col And Line numbers

Download all attachments as: .zip

Change History (12)

@rjc430404
8 years ago

Col And Line numbers

#1 @adamsilverstein
8 years 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
8 years ago

  • Keywords reporter-feedback added

#3 @rjc430404
8 years 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
8 years 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
7 years 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
7 years 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 7 years ago by adamsilverstein (previous) (diff)

#7 @hellofromTonya
4 years ago

Hello @rjc430404,

Does this issue persist for you today? If yes, could you please provide (per Adam's note above):

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

Why? This extra info will help us to further investigate.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


22 months ago

#9 @antpb
22 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

There have been a couple requests for more information in this ticket and it seems consensus is that this is not Core WordPress but likely a JS framework that is conflicting. We'd be curious how that conflict happens but without reproduction steps this is going to be closed out. Feel free to re-open if this is incorrect!

Note: See TracTickets for help on using tickets.