Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#12315 closed defect (bug) (duplicate)

"Link URL" on uploaded images does not update when saving a post

Reported by: broofa's profile broofa Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:

Description

This bug occurs whenever there is a linked image in a post of the form ...

<a href="..." rel="attachment ..."><img src="..." /></a>

Note the presence of the "rel" attribute.

In this case - when the 'rel' attribute is set - changing the URL of the link has no effect. Typically this happens in the "Link URL" field of the image property dialog in the editor.

Previewing the edited post will show a link that appears to point to whatever URL you've specified. However when you actually "update" the post, the URL will revert back to the attached image file.

Setting the "Link URL" field should *always* apply that URL to the link href.

Change History (9)

#1 @broofa
15 years ago

Note: For anyone that finds this issue via Google, you can workaround this problem by going into the "HTML" tab in the editor and deleting the 'rel="attachment ..."' attribute on the link. Once that's deleted, you'll be able to properly set the linked URL.

#2 @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0

#3 @dd32
15 years ago

  • Milestone 3.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #7040

See [13875] Do not add rel="attachment" for direct(File URL, not Post URL) links to non-media files in "Insert into Post". Fixes #7040

#4 @rogermh
14 years ago

  • Cc rogermh added
  • Resolution duplicate deleted
  • Status changed from closed to reopened

This bug is not fixed as confirmed by several on this thread: http://wordpress.org/support/topic/343988

#5 @danorton
14 years ago

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

Dup of #7040

If you don't believe that this is a duplicate, please don't re-open this unless you explain how this is different from #7040.

#6 @rogermh
14 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

I believe that #12315 was incorrectly set to be a duplicate of #7040. #7040 refers specifically to the "File URL" subset of the "Link URL", whereas #12315 refers specifically to WP not saving the URL entered in the "Link URL" field.

Steps to reproduce #12315 on WP 3.0.1:

  • Create a gallery.
  • Click "Show" on any item in that gallery.
  • Enter a URL into the "Link URL" field.
  • Click "Save all changes".
  • Click "Show" on that same item. The "Link URL" field will be blank (i.e., the URL was not properly saved).

Similarly:

  • Select "Show" from any item in the Media library.
  • Enter a URL into the "Link URL" field.
  • Click "Save all changes".
  • Click "Show" on that same item. The "Link URL" field will be blank (i.e., the URL was not properly saved).

#7 @blueajcooper
14 years ago

This issue is definitely alive and kicking. I'm going to have to follow some instructions from the wordpress forums to read the url I need from the description field instead.

Just follow rogermh's instructions above to replicate.

#8 @joelhardi
14 years ago

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

Steps to reproduce #12315 on WP 3.0.1: - Create a gallery. - Click "Show" on any item in that gallery. - Enter a URL into the "Link URL" field. - Click "Save all changes". - Click "Show" on that same item. The "Link URL" field will be blank (i.e., the URL was not properly saved).

Similarly: - Select "Show" from any item in the Media library. - Enter a URL into the "Link URL" field. - Click "Save all changes". - Click "Show" on that same item. The "Link URL" field will be blank (i.e., the URL was not properly saved).

I don't think this is a bug, just confusing UI in the "Add Media" control. "Link URL" isn't actually a property of the image (or whatever item in the media library) -- that link just gets auto-created whenever you click "Show". Then, if you want you can edit the URL and click "Insert into Post" and a linked image is inserted into the post with your URL in the <a href>.

Clicking "Save all changes" saves the other fields into the wp_posts record. It might look like it's supposed to save the Link URL somewhere, but as you know, it doesn't.

Again, Link URL isn't a property of the media item. You can insert the media item many times into many posts, and each time choose a different link. The Link URL field is there so you can put in the URL you want and then click "Insert into Post" to make a link. It's just a tool to make and insert a link.

You may think this is the wrong behavior. I would agree that this confusing/annoying, and it confused me the first time I used it. Thinking out loud, either:

  • clicking "Save all Changes" should save the link URL as some kind of "default URL" for that item, i.e. into wp_postmeta _wp_attachment_metadata (but not insert it into the post), or
  • the UI should be reorganized so that it is obvious that "Save all changes" refers to fields in the item record, while Link URL is associated with the "Insert into Post" button

Anyway, either way I suggest you open a new bug/feature request for the behavior you want, because this bug is a dupe of #7040 (rel="attachment" screws up link URLs on saving of the post ... nothing to do with the Add Media control at all), which has been resolved. So, I'm closing it.

#9 @joelhardi
14 years ago

  • Cc joel@… added

p.s. see #13429 for your issue.

Note: See TracTickets for help on using tickets.