WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#1870 closed defect (bug) (fixed)

Inline Image Uploading creates wrong subpost [rewrited] uris when using wp rather than root folder,

Reported by: mani_monaj Owned by: ryan
Milestone: Priority: high
Severity: major Version: 1.6
Component: Administration Keywords: image uploading bg|has-patch
Focuses: Cc:

Description

It's a little confusing problem , When you use inline uploading when posting new post / editing current posts , in Image Pan it creates a uri like www.yourblog.com/yyyy/mm/dd/post-name/image-name/ or www.yourblog.com/subpost_id=xxx depends on you saved the post or not.

When the image get copied to TinyMCE , there's a bug (I guess in JavaScript) for removing trailing slashes, There is no problem when you have your wordpress in root folder , like the example above , but consider that wordpress is installed here : www.yourblog.com/blog/

in image pan the uri is : www.yourblog.com/blog/yyyy/mm/dd/post-name/image-name/
but in tinymce the uri is : www.yourblog.comblog/yyyy/mm/dd/post-name/image-name/

note that there is no slash between www.yourblog.com & blog.

I double checked the PHP functions related to permalinks and there were no errors there(as we can see the image pan URI is correct) , so I think there's something wrong with JS.

Attachments (2)

pingless.diff (8.9 KB) - added by skeltoac 9 years ago.
Finally, a diff I can upload ;)
pingless.2.diff (9.1 KB) - added by skeltoac 9 years ago.
Forgot edit_post()

Download all attachments as: .zip

Change History (7)

comment:1 @skeltoac9 years ago

  • Owner changed from anonymous to skeltoac
  • Status changed from new to assigned

comment:2 @ryan9 years ago

  • Milestone set to 2.0

@skeltoac9 years ago

Finally, a diff I can upload ;)

@skeltoac9 years ago

Forgot edit_post()

comment:3 @skeltoac9 years ago

  • Keywords bg|has-patch added; trailing slash inline removed
  • Owner changed from skeltoac to ryan
  • Status changed from assigned to new

pingless.2.diff resolves this problem and the double-slash problem with dragged attachment anchors.

Attachment anchors dragged from inline-uploading have attributes rel="attachment" id="##". This enables WP to update the hrefs of these links at any time, even after a change in permalinks, using fix_attachment_links(). This new function is only called in write_post() and edit_post().

This patch also prevents WP from pinging any of its own attachments. It used to ping every attachment to a new post. No longer. Local pings are still allowed post-to-post and attachment-to-post, but all local post-to-attachment pings are prevented.

comment:4 @ryan9 years ago

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

(In [3145]) Attachment cleanups from skeltoac. fixes #1870

comment:5 @anonymous8 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.