Opened 17 years ago
Closed 17 years ago
#4894 closed defect (bug) (fixed)
Atom feed invalid after initial install
Reported by: | rubys | Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | General | Keywords: | atom feed validation has-patch |
Focuses: | Cc: |
Description
Reproduction instructions: create a new WordPress blog. Immediately validate the Atom feed. The initial "This is your first post." post is without an id. Subsequent posts seem to have a correct id.
Suggested fix: default the id to the permalink. Should not break anything with a correct id.
Patch attached.
Attachments (2)
Change History (9)
#3
@
17 years ago
- Keywords needs-patch added
We can just use:
$first_post_guid = get_option('home') . '/?p=1';
Or to be really safe, check the ID of the inserted row after we insert it, and update it.
#4
@
17 years ago
After I create the database and create another post, I get an id of:
<id>http://hostname/wordpress/2007/09/04/test/</id>
In general, should the id be based on, or independent of, the setting of Options => Permalink?
#5
@
17 years ago
In ATOM feeds, the link with rel=alternate is the permalink. The ID is supposed to simply be a globally unique ID. The most important thing about the ID is that it never, ever, changes. It's not tied to your permalink structure, as such, it's simply a unique identifier which never changes.
This is why we use the post->guid field to store it. If the permalink structure changes, the ID field won't.
So the real problem here is what ryan and mark say, we don't set a post_guid for the first post in the wp_install_defaults().
+1 to mark's suggestion. Adding a simple /?p=1 will work just fine. I'd go so far as to suggest that we make the ID always use the /?p=XX link style, but that's outside the scope of this ticket.
Perhaps we should manufacture a guid for them in wp_install_defaults() so that we can avoid the special case. I think we have enough info at that point in the install to create a decent guid.