New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(media-uploads): WP's media uploader is uploading to incorrect directory when Give is active #2830

DevinWalker opened this Issue Feb 21, 2018 · 2 comments


None yet
3 participants

DevinWalker commented Feb 21, 2018

Issue Overview

Reported on and I was able to reproduce:

It was thought that it was multisite related but I was able to reproduce on a standard install.

See video:

Expected Behavior

Standard WP media uploads are unaffected by Give plugin.

Current Behavior

Uploads are going to an incorrect folder directory.

Possible Solution

Steps to Reproduce (for bugs)

Watch video:


This comment has been minimized.


mehul0810 commented Feb 21, 2018

After doing research on this issue, I've noticed that code of Give Core is affecting global variable $GLOBALS['post'] due to which when uploading image manipulates get_post fn used in media_handle_upload() when passed with null value returns the latest Give Donation Form object - strange behaviour. Still looking what is affecting this to happen.

To check what happens, print $post and die() here and then upload an image and check network tab to see the async-upload response


This comment has been minimized.


ravinderk commented Feb 21, 2018

@DevinWalker @mathetos This is known bug in WP core. To fix this issue I am using get_posts instead of WP_Query #2831 because wp_reset_postdata does not work in admin.

For Ref:

DevinWalker added a commit that referenced this issue Feb 21, 2018

Merge pull request #2831 from /issues/2830
fix(media-uploads): upload file to correct folder #2830
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment