[wp-trac] [WordPress Trac] #26992: Failing to make new yyyy/mm for uploads affects existing URLs (WP_CONTENT_URL, wp_get_attachment_url and GUID)

WordPress Trac noreply at wordpress.org
Sun Feb 2 17:53:14 UTC 2014


#26992: Failing to make new yyyy/mm for uploads affects existing URLs
(WP_CONTENT_URL, wp_get_attachment_url and GUID)
--------------------------+-----------------------------
 Reporter:  tivnet        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Permalinks    |    Version:  3.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 What happens:

 - I have the `WP_CONTENT_DIR` and `_URL` pointing somewhere, not where the
 WP is installed.

 - There was an error creating upload folder `yyyy/mm` (permission issues)

 - `wp_get_attachment_url()` could not go through the `if ( ($uploads =
 wp_upload_dir()) && false === $uploads['error'] )` block and came to the
 "not recommended to rely upon" `$url = get_the_guid( $post->ID );`

 The GUID returned completely ignored my settings. It started with the
 default `/wp-content/`. Obviously. Those attachments were made before I
 moved the wp-content, and nobody fixed the GUIDs.

 Result: all images broken.

 I believe, something has to be changed here, so '''when the upload
 directory for new attachments cannot be created, it won't affect the
 existing attachments'''.


 ----


 Code Path:
 `wp_get_attachment_image_src -> image_downsize -> wp_get_attachment_url`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26992>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list