Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#2464 closed defect (bug) (fixed)

Greymatter import support missing

Reported by: bungeman's profile bungeman Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0.1
Component: Administration Keywords: greymatter, import, bg|has-patch
Focuses: Cc:

Description

So I went and installed Wordpress 2.0.1 and greymatter.php is 0kb. While this is a very zen solution, most people don't appreciate the wonder of this.

Attachments (10)

greymatter.php (11.3 KB) - added by bungeman 18 years ago.
greymatter import for 2.0.1. It worked for me.
2464.diff (17.0 KB) - added by szepter 18 years ago.
greymatter.php as unified diff against the current revision
greymatter.diff (12.1 KB) - added by bungeman 18 years ago.
this file should be used instead of the other two, it has about 3 lines difference, mostly adding 'published' status instead of 'draft'.
greymatter.2.php (11.5 KB) - added by bungeman 18 years ago.
I'm putting this (final) version here so people can just use it if they wish.
greymatter.2.diff (9.6 KB) - added by bungeman 18 years ago.
full (and hopefully last) diff for greymatter importing
greymatter.3.php (9.1 KB) - added by bungeman 18 years ago.
newest version of the file, interface cleaned up, all DB stuff removed, all of ryan's sugestions incorporated
greymatter.3.diff (9.6 KB) - added by bungeman 18 years ago.
really, last time, replaced addslashes with $wpdb->escape
greymatter.4.php (9.1 KB) - added by bungeman 18 years ago.
same as above, just easier to download, if needed
greymatter.4.diff (10.2 KB) - added by bungeman 18 years ago.
ok, I swear its the last time, this one doesn't duplicate entries if you import again. There, I'm going outside now.
greymatter.5.php (9.7 KB) - added by bungeman 18 years ago.
you know the drill

Download all attachments as: .zip

Change History (16)

@bungeman
18 years ago

greymatter import for 2.0.1. It worked for me.

#1 @bungeman
18 years ago

  • Keywords bg|has-patch added

@szepter
18 years ago

greymatter.php as unified diff against the current revision

@bungeman
18 years ago

this file should be used instead of the other two, it has about 3 lines difference, mostly adding 'published' status instead of 'draft'.

@bungeman
18 years ago

I'm putting this (final) version here so people can just use it if they wish.

#2 @bungeman
18 years ago

This may end up on another ticket, but since this is using wp_insert_post it sends the 'publish_post' signal which by default runs generic_ping, and if the ping hangs you get a random error message involving class-IXR and the import just up and dies. Signal handlers like generic_ping need to keep in mind that they can bring down a lot more than just themselves.

#3 @ryan
18 years ago

  • Milestone set to 2.1

Avoiding the generic_ping() during import is will be fixed in 2.1. Importers should be using wp_insert_post().

A few things need to change though:

Use username_exists() instead of doing a SELECT on user_login.

Remove the call to upgrade_all(). It is not necessary.

Remove the SELECT * on $wpdb->posts. It doesn't look like it is really needed.

Never use mysql_query. Use $wpdb for all database operations.

Thanks.

#4 @bungeman
18 years ago

Cool beans. I know the thing needs a lot of work, I just took bits of the old import-greymatter.php and threw it into the outline of the new mt.php with enough modifications to make it work. I've never seen Wordpress before two days ago, so I'm still finding my way about a bit.

@bungeman
18 years ago

full (and hopefully last) diff for greymatter importing

@bungeman
18 years ago

newest version of the file, interface cleaned up, all DB stuff removed, all of ryan's sugestions incorporated

@bungeman
18 years ago

really, last time, replaced addslashes with $wpdb->escape

@bungeman
18 years ago

same as above, just easier to download, if needed

@bungeman
18 years ago

ok, I swear its the last time, this one doesn't duplicate entries if you import again. There, I'm going outside now.

@bungeman
18 years ago

you know the drill

#5 @ryan
18 years ago

Looks good. It needs some i18n work, but we can take care of that separately.

#6 @ryan
18 years ago

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

(In [3546]) greymatter importer from bungeman. fixes #2464

Note: See TracTickets for help on using tickets.