WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7305 closed defect (bug) (duplicate)

Image uploader expects the upload path to be "wp-content/uploads"

Reported by: da3rX Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.6
Component: Administration Keywords:
Focuses: Cc:

Description

I have changed the default upload path "wp-content/uploads" to something else from the WordPress settings.
Now when I upload an image, it is uploaded to the correct directory BUT the HTML IMG tag's SRC attribute is still showing the default "wp-content/uploads" path (and obviously the image is not displayed). The value is probably hard-coded somewhere.

Attachments (1)

image_url.patch (605 bytes) - added by Txanny 6 years ago.
Patch to solve this problem

Download all attachments as: .zip

Change History (8)

comment:1 da3rX6 years ago

I think this is happening because the "upload_url_path" option has no value in my database and the wp_upload_dir function in wp-includes/functions.php is setting it to the default value:

if ( !$url = get_option( 'upload_url_path' ) )
	$url = WP_CONTENT_URL . '/uploads';

I am not sure where the "upload_url_path" option needs to be set though. Probably when saving the settings.

comment:2 da3rX6 years ago

I filled the "Full URL path to files (optional)" field in Settings > Misc and I think it is working now.

Shouldn't that field be optional? :P

comment:3 DD326 years ago

Shouldn't that field be optional? :P

Its only optional if you leave the upload path as default.. :P

comment:4 da3rX6 years ago

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

comment:5 Txanny6 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

No, it's not an invalid ticked.

The screen says OPTIONAL, and optional means optional in all cases.
Was optional and worked in all versions but 2.6

If it's no optional anymore, should change the field label, and be filled when updating.

comment:6 ryan6 years ago

  • Resolution set to duplicate
  • Status changed from reopened to closed

See #7308 for the fix.

Txanny6 years ago

Patch to solve this problem

comment:7 thee176 years ago

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