Title: File Upload JS Error
Last modified: August 20, 2016

---

# File Upload JS Error

 *  Resolved [cus003](https://wordpress.org/support/users/cus003/)
 * (@cus003)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/)
 * I’ve just updated to the latest version of Custom Fields Suite and it seems to
   have broken.
 * Whenever I click the “Add File” button, nothing loads and I get JS errors:
 * 1) Uncaught TypeError: Cannot read property ‘length’ of undefined – load-scripts.
   php:2
 * 2) Uncaught ReferenceError: wp is not defined – post-new.php:547
 * In reality, the code in question for #2 lies in “file.php” in the plugin files.
 * Does anyone know what’s going on here?
 * Thanks a lot,
    Marcus
 * [http://wordpress.org/extend/plugins/custom-field-suite/](http://wordpress.org/extend/plugins/custom-field-suite/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488367)
 * Hi Marcus,
 * First, refer to the troubleshooting guide: [http://uproot.us/docs/how-to-troubleshoot-plugin-issues/](http://uproot.us/docs/how-to-troubleshoot-plugin-issues/)
 * Please go through the first few steps. Also paste your site’s debug information(`
   Field Groups > Tools`, then click on the `Debug` tab).
 *  Thread Starter [cus003](https://wordpress.org/support/users/cus003/)
 * (@cus003)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488537)
 * Hey, thanks for the quick reply.
 * Here’s the debug info:
 * WordPress 3.5.1
    PHP 5.3.18 Apache Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/
   537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17
 * — Active Plugins —
    Add From Server 3.2.0.2 Adminimize 1.8.2 Admin Menu Editor
   1.1.13 Codepress Admin Columns 1.4.9 CPT-onomies: Using Custom Post Types as 
   Taxonomies 1.2.1 Custom Field Suite 1.8.6 Google XML Sitemaps 3.2.9 Peter’s Login
   Redirect 2.6.1 Prevent Password Reset 0.1 Quick Cache 111203 Remove quick edit
   1.1 Simple 301 Redirects 1.03 White Label CMS 1.5.1 WP Block Admin 0.2.3.0 Wp
   Ultimate CSV Importer 2.0.0
 * Just trying to troubleshoot it myself as well.
 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488538)
 * Is your main content editor defaulting to “HTML” instead of “Visual” mode? If
   so, give this patch a try:
 * [https://github.com/mgibbs189/custom-field-suite/commit/255896219cc176c3ff91542b9e1eff6a0a48f4ba](https://github.com/mgibbs189/custom-field-suite/commit/255896219cc176c3ff91542b9e1eff6a0a48f4ba)
 *  Thread Starter [cus003](https://wordpress.org/support/users/cus003/)
 * (@cus003)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488540)
 * Well, the main content editor was, and now isn’t. However, the problem still 
   remains.
 * Also, how would I make that change stay with updates?
 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488559)
 * The code is already committed to the codebase, and thus will be released along
   with the next version.
 * Anywho, have you done any of the troubleshoot steps? The most important thing
   to check is to disable all plugins *except* CFS, then see if the issue is still
   there.
 *  Thread Starter [cus003](https://wordpress.org/support/users/cus003/)
 * (@cus003)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488561)
 * Ok I’ll do that tomorrow and report back. Thanks for your help so far!
 *  Thread Starter [cus003](https://wordpress.org/support/users/cus003/)
 * (@cus003)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488583)
 * I think I’ve solved it. Basically, because WordPress loads jQuery in the admin
   automatically, I had some code in my functions.php which loaded jQuery only if
   the user wasn’t in the admin panel, but then for some reason put loading the 
   jQuery UI framework outside of the is_admin function check. Just whacked it inside
   and all seems to be OK. Strange that it worked fine until updating to the latest
   version of the plugin though!
 * Thanks again for your help!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘File Upload JS Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [cus003](https://wordpress.org/support/users/cus003/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/file-upload-js-error/#post-3488583)
 * Status: resolved