Make WordPress Core

Opened 5 years ago

Closed 2 years ago

#48604 closed defect (bug) (worksforme)

File upload bug

Reported by: majoran's profile majoran Owned by:
Milestone: Priority: high
Severity: normal Version:
Component: Media Keywords: close
Focuses: Cc:

Description

Hi,
We just upgraded WordPress to 5.3 and uploading file through Add media within article edit page is not possible now. Seems to be a bug there.

Regards
Majoran

Change History (31)

#1 @svkovalyov
5 years ago

I confirm, I also encountered this error
Uncaught TypeError: Cannot convert undefined or null to object
in browser console

Last edited 5 years ago by svkovalyov (previous) (diff)

#2 @joemcgill
5 years ago

  • Component changed from General to Media
  • Priority changed from normal to high

Hi @majoran. Thanks for reporting this and to @svkovalyov for confirming. Can either of you provide more details about exactly how to reproduce this bug, including which editor you are using (i.e. Gutenberg or the Classic Editor) and the steps you are taking to upload a file? Even better if you can share a video demonstrating the behavior.

Thanks!

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


5 years ago

#4 @majoran
5 years ago

We are using classic editor. I think problem might be related to that.

I will send video tomorrow. It's night in Oslo. It's very easy to reproduce this bug. I hope there wil come an update.

Classic editor is used by many people because of the easy interface.

#5 @SergeyBiryukov
5 years ago

Related/duplicate: #48620

#6 @Otto42
5 years ago

Also try clearing your browser cache. Browsers are particularly picky about holding onto old javascript files after updates.

#7 @afercia
5 years ago

  • Keywords reporter-feedback added

Also: Can you confirm that the bug still exists with the default theme activated and all other plugins deactivated?

#8 @SergeyBiryukov
5 years ago

#48632 was marked as a duplicate.

#9 @sajjad67
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

@majoran With Twenty Nineteen default theme with no plugins activated... i confirm your report is false. Tried many pages and browsers.. But not an issue i found.. I highly doubt that your browser cache is causing the error. or maybe another plugin or theme file... Please use a different Browser with clean cache and check again. Also check if any activated plugin is conflicting...

#10 follow-up: @majoran
5 years ago

@sajjad67 Hi. Thanks for reply.

The issue is still there. Please note that we use classic editor which is a plug in, however this plug in is from WordPress team.

I hope someone from this team will either update the classic editor or update wp core.

#11 in reply to: ↑ 10 @sajjad67
5 years ago

Replying to majoran:

@sajjad67 Hi. Thanks for reply.

The issue is still there. Please note that we use classic editor which is a plug in, however this plug in is from WordPress team.

did you try disabling all plugins and use default theme yet... i can't reproduce the error.. so it's hard for me to tell anything. if you could create a video of the issue you are having that would be great.. And the error need to come from core code to solve it.. Check and let us know

#12 @SergeyBiryukov
5 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Let's please not call anyone's report "false", even if the issue could not be reproduced, it's not very friendly :)

Reopening for now to allow for more testing and identifying the issue. Does it still happen with all plugins disabled and a default theme (Twenty Twenty) activated?

#13 @sajjad67
5 years ago

@majoran i am sorry! Let us of course do some more testing to be sure if it's really an issue... @SergeyBiryukov Thanks... Really Appreciated...

#14 @afercia
5 years ago

With all plugins disabled except Classic Editor :) Still can't reproduce though.

#15 @majoran
5 years ago

Hi,

It works.

A plug in called WP Offload media is the plug in causing this bug.

Sorry if we caused any inconvenience.

#16 @afercia
5 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
  • Version 5.3 deleted

Thanks @majoran! No worries, any feedback is always welcome and double checking potential issues is always worth it.

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


5 years ago

#18 @ianmjones
5 years ago

@majoran If you think this might be a bug in WP Offload Media 2.3, please can you submit a support request via the "Support" tab in the plugin?

If this is WP Offload Media Lite 2.3, please raise an issue at https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/issues if it looks like a bug.

In either case, if you have anything in wp-content/debug.log to share, that would be very helpful along with the Diagnostic Info from the plugin's "Support" tab.

If you're using an older version of WP Offload Media such as 2.2.1 or earlier, then you need to upgrade for WordPress 5.3!

https://deliciousbrains.com/wp-offload-media-2-3-released/

#19 follow-up: @majoran
5 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

We have tested thoroughly, it's not due to WP Offload media.

It's due to Classic editor. We tried on a new fresh wp installation. Same problem: not able to upload media from the post edit page.

Edit any page, press Add media button. Upload from there to reproduce.

I see that there are other users complaining on the sanw.

#20 follow-up: @svkovalyov
5 years ago

I resolve problem - clean cache

#21 in reply to: ↑ 19 @azaozz
5 years ago

Replying to majoran:

It's due to Classic editor.

Just re-tested with and without the Classic Editor plugin and everything seems to be working as expected.

Could you follow the steps from this thread: https://wordpress.org/support/topic/unable-to-upload-images-67/page/2/#post-12133521 and post the errors you see either there or here please.

#22 in reply to: ↑ 20 @azaozz
5 years ago

Replying to svkovalyov:

I resolve problem - clean cache

Yeah, unfortunately browser and/or network caching can still cause problems after all these years...

#23 @SergeyBiryukov
5 years ago

  • Milestone set to Awaiting Review

#24 @tomestlack
5 years ago

Problem likely related to something going on in a set of theme files. I ran into similar issues. Tested (with sitehealth PI) on themes from 2019, 2017, 2011, Genesis - all worked fine. Also removing all plugins. Site built with "custom" child (maybe) theme. Very buggy to begin with. The only time it failed was when testing on "custom" theme.

-- Forgot to mention this...
Using the same "custom" theme, some sites are not exhibiting this problem - so, at a loss as to where the problem lies. So, typical methods of narrowing down what problem exactly is, don't seem to apply here.

Last edited 5 years ago by tomestlack (previous) (diff)

#25 follow-up: @tomestlack
5 years ago

OK - speaking of cache!
For me. I had to go into the error and delete from my CDN cache, the file that was throwing the error. This took almost an entire day of digging. In this case it was this JS include file.

/wp-includes/js/backbone.min.js

For some reason it was cached in CDN - I purged it, and for some reason it's OK now. Maybe this will help.

#26 in reply to: ↑ 25 ; follow-up: @StandOutSites
5 years ago

We are on Siteground and user SG Supercache. I cleared cache several times to no avail. Even after I deleted /wp-includes/js/backbone.min.js, the file was still loading. Just created a ticket with Siteground to clear this file from server cache. Has this solution consistently work for you?

Replying to tomestlack:

OK - speaking of cache!
For me. I had to go into the error and delete from my CDN cache, the file that was throwing the error. This took almost an entire day of digging. In this case it was this JS include file.

/wp-includes/js/backbone.min.js

For some reason it was cached in CDN - I purged it, and for some reason it's OK now. Maybe this will help.

#27 follow-up: @StandOutSites
5 years ago

The plugin that's causing this issue on our site is Enhanced Media Library PRO. Once disabled, the uploading gets fixed. It's sad, as this is a very essential plugin for our site. We have have to downgrade to previous WP version.

#28 in reply to: ↑ 27 @StandOutSites
5 years ago

For those who are experiencing this error due to Enhanced Media Library (free or PRO). The issue is related to the code in file js/eml-media-views.js. The fix was provided by https://wordpress.org/support/topic/potential-fix-wordpress-5-3-conflict-compatibility-error/#post-12156318

The issue is related to the upgrade of Backbone in WordPress 5.3. Maybe other plugins have the same issue, which is described here https://make.wordpress.org/core/2019/10/10/wordpress-5-3-backbone-upgrade-guide/

Replying to StandOutSites:

The plugin that's causing this issue on our site is Enhanced Media Library PRO. Once disabled, the uploading gets fixed. It's sad, as this is a very essential plugin for our site. We have have to downgrade to previous WP version.

#29 @majoran
5 years ago

  • Keywords close added

I confirm the plugin that's causing this issue on our site is Enhanced Media Library. When this is disabled everything is fine.

#30 in reply to: ↑ 26 @tomestlack
5 years ago

Replying to StandOutSites:

We are on Siteground and user SG Supercache. I cleared cache several times to no avail. Even after I deleted /wp-includes/js/backbone.min.js, the file was still loading. Just created a ticket with Siteground to clear this file from server cache. Has this solution consistently work for you?

So far, yes - the solution is working...

But the specific files, plugins, includes etc. could be different per user/dev. I'm not a WP architect or moderator, but I would recommend the following to anyone experiencing similar issues.

attempt to recreate problem in different browsers.
use the inspector -> console - locate problem files and their specific paths (right click on file name - copy link location, paste in new window, so you can use the path to dump from cache later - (CDN cache or a WP cache plugin etc.)).
it seems like many people are having problems related to a cached javascript file in a plugin (or include files), whether it's Media Library or Backbone or something else. Even if it's unrelated, a JS error could cause other stuff to break (preaching to the choir here probably).
If you're using a service to cache files, you may have to provide the specific path of the file you need to purge from your cache. In my case, I've been using cloudflare a lot for this (custom purge).

Re: cache - The more I learn about cache, the less I understand about cache
So, after the server cache is purged, and the CDN cache is purged, we still have the browser cache to purge. All the caches will store files and paths you're trying get to read directly from your server environment. So, purge everything so you're getting a fresh clean download. It sounds scary, but it might help. Try using a top down approach:

  1. purge CDN cache
  2. purge server cache
  3. purge caches from any WP plug ins
  4. purge browser caches - You don't have to delete the browsing history or cookies - just cached images + files (browser might log you out otherwise)

---

Maybe there is a bug somewhere, but I haven't identified a REAL BUG >> If I'm wrong, just ignore the above and accept my apologies :)

Last edited 5 years ago by tomestlack (previous) (diff)

#31 @hellofromTonya
2 years ago

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

Hello all,

After reading all the comments, it seems the reported issue was not due to Core itself but due to plugins and/or potentially theme(s).

Given that it's over 3 years without additional reports, I'm closing this ticket as worksforme.

if the problem persists today, please follow-up with the following information:

  • Check if the problem exists when using a default theme with no plugins activated.
  • Clear the CDN, server, and browser cache.
  • Provide a detailed list of the step-by-step instructions of how to reproduce the issue.

This extra steps and information help contributors to continue investigating. If after doing the above the problem continues for you, please reopen and share your findings and the information requested.

Note: See TracTickets for help on using tickets.