Support » Plugins and Hacks » Hacks » Trouble setting date/time with wp.editComment wp.newComment API

Trouble setting date/time with wp.editComment wp.newComment API

  • Background: I’m trying to transfer the contents of my non-wordpress blog to my self-hosted wordpress blog. My prior blog was on Lithium, and it doesn’t seem to have a supported import format. I got all the posts imported using RSS import, but the comments were not imported properly.

    I am writing a comment uploader using the XML-RPC wp APIs and some perl code.

    I can successfully upload a comment with wp.newComment and I can edit some fields of the comment with wp.editComment . But, I get an error message when I try to change the date_created_gmt field. Does anybody know how to edit the date_created_gmt field of a comment? I’ve tried various formats for this field but I can’t seem to get it right.

    My error message is:

    <b>Fatal error</b>: Call to a member function getIso() on a non-object in <b>/home1/susiewee/public_html/blogtest/wp-includes/class-wp-xmlrpc-server.php</b> on line <b>1155</b>
    unknown RPC type ‘br’
    at line 1 column 0


Viewing 1 replies (of 1 total)
  • After even more web searches, I found the problem was that I was passing the date_created_gmt field in XML as a ‘<string>20070326T08:35:00</string>’ value while the server was expecting it as a ‘<dateTime.iso8601>20070326T08:35:00</dateTime.iso8601>’ value. I could not get my perl libraries to send the dateTime.iso8601 format, so I ended up hacking my wordpress server file wp-includes/class-wp-xmlrpc-server.php to remove ‘->getIso()’ wherever it appeared. After doing this, my comments continued to upload using wp.newComment and my dates edited properly using wp.editComment.

    I guess the question is whether this is considered an error or a design choice. I’d recommend using the ‘string’ representation and specifying the required format of the string.


Viewing 1 replies (of 1 total)
  • The topic ‘Trouble setting date/time with wp.editComment wp.newComment API’ is closed to new replies.
Skip to toolbar