Hi Ritesh,
Found the bug, the firs time the function is called it has a relative file name like
2016/12/20/filename.jpg
second time
site/2/2016/12/20/filename.jpg which at the end overwrites the url based on the relative file name.
Now thinking about a patch for it. I can’t seem to find the reason the function is called twice since.
Steps I take:
- Go to wp-admin/media-new.php
- Select a file and upload it
- Monitor log file where I dumpt the data, no page refreshes or so just waiting and method is called twice
Hope that guides you to, I will keep digging for a patch
Joren
Hi Ritesh,
Usign debug_backtrace() at the beginning of the function that gave me an output, but I don’t get much more info out of it, maybe you see something?
In the gist the second file is a possible patch for the bug, at least that patch works at my end and makes sure that the second time it’s called it uses the correct path. This doesn’t solve why it’s called twice. But since I’m not doing anything special I think more people will have this issue..
https://gist.github.com/jorenvh/2e8dd5be53e5e3198f3003d39bd5fa88
Kind regards,
Joren
Hi Joren,
I can see EWWW Image Optimizer plugin in callback which triggered second call of wp_update_attachment_metadata (at line 548 in gist). Can you check new uploads with that plugin disabled? I was under impression that you were testing with all the plugins disabled. Also, you can check https://github.com/10up/windows-azure-storage/tree/fix/smush-conflict code which fixes a conflict with both Smush and EWWW Image Optimizer plugin.
Regards,
Ritesh
Hi Ritech,
Damnit, network deactivating the EWWW Image Optimizer plugin doens’t disable it on the subsites, you have to do that manually on each sites. That’s why the issue kept happening that plugin wasn’t actually disabled. (my sidebar was clean and that menu item is hidden in a sub tree that’s why I missed that.)
I tested again with the plugin disabled and it works just fine. Besides that I have download the smush-conflict version of the plugin and that also works as aspected!
My apologies that I didn’t noticed this earlier.
And a big thank you for the great support!
Best regards,
Joren
EDIT: Ps. I will keep the plugin on the subtree with the fix for know, any idea when it will be released?
-
This reply was modified 7 years, 9 months ago by jorenvh.
Hi Joren,
I am glad to know that Smush fix worked. That Smush conflict fix is originally part of https://wordpress.org/support/topic/appears-to-break-with-4-7/ thread. Once we have confirmation that it’s working, we will release it.
Regards,
Ritesh
Hi Joren,
We have released a new update of the plugin (version 4.0.1) which fixes this issue. Can you check and let us know if you still face the issue?
Regards,
Ritesh