WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 11 months ago

Last modified 11 months ago

#19374 closed defect (bug) (wontfix)

Uploader uses wrong path when inserting images

Reported by: ryanmurphy Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Upload Keywords: has-patch
Focuses: Cc:

Description

Issue:

I recently had someone whose WordPress install I take care of tell me that when they went to upload images, they weren't being shown. At the time, she was using a svn copy that hadn't been svn up'd in a few weeks. I noticed that the uploads were being stored in the right location, but the uploader was using the default wp-content/uploads location when it inserted it into the post, causing the images to not show up.

I just confirmed that this still exists in r19456. It happens with all plugins deactivated and on the default theme.

To replicate:

  1. On the options-media.php, change the upload path to something of your choosing. For mine, I chose /usr/home/user/domains/my-domain.com/public_html/wp-content/my-uploads/
  2. If needed, created the folder and adjust permissions.
  3. Create a new page/post, upload an image, and insert it into the post. Take note of the address, it should be wrong according to the newly set upload path.
  4. On the server, check the new location, as well as wp-content/uploads. The file will be in the new location (as expected), and not in wp-content/uploads.

Attachments (1)

19374.diff (765 bytes) - added by RyanMurphy 3 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 dd323 years ago

The upload path in the admin should be set to a relative-to-ABSPATH I believe, and you're also expected to fill out the URL if you change the location. Either (or both) of those 2 assumptions should correct the issue you're seeing.

The settings page does need to be a bit more clear, it also needs to process the data on there, and show some more info (ie. guess the resulting url).

comment:2 kurtpayne3 years ago

  • Cc kpayne@… added

If I set the path to uploads folder to an absolute path, then I could replicate the failure describe in the ticket.

If I set the path to the uploads folder to a relative path (e.g. wp-content/my-uploads), as described by dd32, then the uploads worked as indicated. Files went to the correct folder, images displayed correctly in the library, when inserting into a post, and on the public site.

RyanMurphy3 years ago

comment:3 RyanMurphy3 years ago

  • Cc ryan@… added

Sorry it's taken this long for me to reply, I used to get emailed without CC'ing on tickets I created, but I guess that changed.

Replying to dd32:

The upload path in the admin should be set to a relative-to-ABSPATH I believe, and you're also expected to fill out the URL if you change the location. Either (or both) of those 2 assumptions should correct the issue you're seeing.

The settings page does need to be a bit more clear, it also needs to process the data on there, and show some more info (ie. guess the resulting url).

It works when I fill in the URL.

Replying to kurtpayne:

If I set the path to the uploads folder to a relative path (e.g. wp-content/my-uploads), as described by dd32, then the uploads worked as indicated. Files went to the correct folder, images displayed correctly in the library, when inserting into a post, and on the public site.

Works for me too once I change it to a relative location.

I've attached a patch which adds more information to the URL setting

comment:4 SergeyBiryukov3 years ago

  • Keywords has-patch added

comment:5 c3mdigital11 months ago

  • Keywords needs-refresh added

upload_path and upload_url_path option fields hidden if set to default in options-media.php in [21852]. We should still update the description when those fields are shown.

comment:6 nacin11 months ago

19374.diff seems fine but I don't care too much. Given [21852] (which basically deprecated this UI), close it?

comment:7 c3mdigital11 months ago

  • Keywords needs-refresh removed
  • Resolution set to wontfix
  • Status changed from new to closed

Agreed, since the UI is gone.

comment:8 SergeyBiryukov11 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.