Ticket #1870 (closed defect (bug): fixed)

Opened 6 years ago

Last modified 5 years ago

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

Reported by: mani_monaj Owned by: ryan
Priority: high Milestone:
Component: Administration Version: 1.6
Severity: major Keywords: image uploading bg|has-patch
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

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

Change History

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

comment:2   ryan6 years ago

  • Milestone set to 2.0

Finally, a diff I can upload ;)

Forgot edit_post()

  • Keywords bg|has-patch added; uploading, 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   ryan6 years ago

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

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

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.