Opened 6 years ago
Closed 6 years ago
#4894 closed defect (bug) (fixed)
Atom feed invalid after initial install
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.3 |
| Component: | General | Version: | 2.3 |
| Severity: | normal | Keywords: | atom feed validation has-patch |
| 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)
- Keywords atom feed validation added
- Milestone set to 2.3
- Version set to 2.3
comment:3
markjaquith — 6 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.
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?
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.
- Keywords has-patch added; needs-patch removed
Patch based on suggestion by markjaquith added.
comment:7
markjaquith — 6 years ago
- Resolution set to fixed
- Status changed from new to closed

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.