WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3418 closed defect (bug) (fixed)

Issues with importing/converting blogroll from 2.0.5

Reported by: Viper007Bond Owned by:
Milestone: Priority: high
Severity: normal Version: 2.1
Component: General Keywords:
Focuses: Cc:

Description

Just upgraded my live blog from 2.0.5 to latest SVN (r4578) and had some issues with blogroll categories.

Everything appears to have been imported just fine (no missing data), however the links were put into some additional categories. All of the links are there and are filed in their original categories, but they are also filed in some of my existing post categories. There doesn't seem to be a pattern as these additional categories were picked, but I may be missing it.

And I'm not going to even bother to speculate what's up -- I'll leave that to someone more in the know with the new blogroll code (I'm not up to date on it yet).

Can provide details as needed.

Attachments (1)

cats.png (54.4 KB) - added by Viper007Bond 8 years ago.
After upgrade, before fixing manually

Download all attachments as: .zip

Change History (13)

comment:1 @Viper007Bond8 years ago

  • Cc trac@… added

comment:2 @Viper007Bond8 years ago

  • Cc wptrac@… added; trac@… removed

@Viper007Bond8 years ago

After upgrade, before fixing manually

comment:3 @ryan8 years ago

upgrade_210() in upgrade-functions.php is the responsible code if someone wants to give it a look.

comment:4 @BrianLayman8 years ago

I'm a little concerned about the merging code in this area...

Ok, so basicaly, because of the code in admin-db.category_exists, the first category wins. However, since no "order by" clause is specified in that query, we aren't going to know for sure which the "first" category is going to be. At least that's how it would work in a relational DB. The order of the results would be dependant upon the order in which the data was inserted and when it was modified last. So the order could be by ID or it could be by when the user inserted it or if they did a restore it could be the order by which the restore inserted the records.

Additionally, the Category_exists function doesn't cast the stuff to a specific case when checking for an existing name. So we could end up with WordPress and Wordpress categories (as an example) because of how the blogger first typed them in in Posts vs links. I don't know if that's a design choice, or design oversight. Either way could be argued for I suppose, but there are no comments in the code indicating whether this issue was considered.

comment:5 @BrianLayman8 years ago

nm on uppercase/lowercase thing. I see sanitize_title actually converts to lowercase. But I do think an

ORDER BY category_parent , cat_ID

could be added.

comment:6 @ryan8 years ago

I cleaned up the upgrade code a bit and ran some test upgrades with a mix of links and cats. Worked for me. Anyone have a 2.0 DB I can test with?

comment:7 @foolswisdom8 years ago

  • Milestone changed from 2.1 to 2.1.1

comment:8 @Nazgul8 years ago

  • Milestone changed from 2.1.1 to 2.1.2

comment:9 @foolswisdom8 years ago

  • Milestone changed from 2.1.3 to 2.2

comment:10 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:11 @mattyrob8 years ago

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

I think this may have been fixed by this similar ticket:

http://trac.wordpress.org/ticket/4813

comment:12 @Nazgul8 years ago

  • Milestone 2.3 deleted
Note: See TracTickets for help on using tickets.