Link to File changes to Link to Attachment IF PAGE IS STARTPAGE

Description

bug when editing a page which is set as static blog start page:
when inserting a link to a mediafile, wp inserts this "rel="attachment..." tag, even if "file URL" was selected. this causes the link to change to the attachment instead of linking to the file directly.

if i change the startpage to some other page/article before editing the page, everything works fine.

I have replicated this and believe it to be an active bug - reopening.
Took a quick look at the code but am not sure how the
rel="reference" attribute
is handled for links that are generated from the Media Library.

I have replicated this and believe it to be an active bug - reopening.
Took a quick look at the code but am not sure how the
rel="reference" attribute
is handled for links that are generated from the Media Library.

Regards,
Kathy

Can you detail how you reproduced this please as when I tested it worked fine.

I can confirm this error. I am using 2.7 and have tested this on two different sites. When attempting to insert a pdf on the main page of the website rather than linking to the pdf a link to a post page is created and on that page a link will appear in the body to the actual document. Before publishing I have checked the link for the correct path to the pdf as well as once inserted i check the path using the "insert/edit link" button to check the path one last time. After the page is published I view it and what you get is a link to ​http://www.xxxxxxx.com/xxxxxpost instead of ​http://www.xxxxxx.com/xxxx.pdf . I have tested this on other pages outside of the main / static page and it works. Error only occurs when attempting to insert media in the main page.

Using Wordpress 2.7

open / edit main page

click "add media" button

click select files (flash loader button does not work, I think it may because of Flash Player 10)

select document (pdf)

select "file URL" in the Link URL option. This used to be the default, now an option must be chosen

select insert to post

click in the link in the post box and then select "link / edit" button

verify correct path to the document

publish page

view page / link will not be to document rather to a post

only happens on main page / works on all others

Hope this helps. I set the priority to high only because this is a productivity issue for some of my clients attempting to update their sites.

I had the issue when trying to insert a link to a PDF file in the Media Library into the (static) homepage page. The rel attribute was getting added and then on updating the page, the link would get re-written replacing the "wp-content/upload/year/month/day/" with the page name and dropping the ".pdf" extension and so WP takes you to an intermediate page which then gives the proper link to the file.

Also, it appears to only be an issue for links on the homepage, with the static homepage option set, I can properly add links to the same PDF onto other pages.

To reproduce simply download the 2.9.2 version (I use czech language mutation, but there should be no difference).
Do the fresh installation. Go to options-reading.php, set static page as the first page, you can choose that "about me" page. Then go to edit-pages.php, edit that sample page that is already there and you did set it as first page.
Add a file and you will see in the HTML that the link is someting like: "<a href='​http://site/ai/wp-content/uploads/2010/03/letak_voziky1.pdf' rel='attachment wp-att-6'>letak_voziky</a>".
Notice that: rel='attachment wp-att-6'
After you publish, you will get: <a href='​http://site/ai/?attachment_id=6' rel='attachment wp-att-6'>letak_voziky</a>.
Now the pdfd extension is gone, and you have to download it through another page, which is very annoying.

This has been done on fresh installation, no other changes to installation has been made, no .htaccess, no another plugin, nothing, just new install.