Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#6483 closed defect (bug) (invalid)

Using mt.publishPost results in posts having date of November 30th, 1999

Reported by: nstech's profile nstech Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.3.3
Component: XML-RPC Keywords: mt.publishPost publishPost xmlrpc
Focuses: Cc:

Description

I am guessing that the functionality of mt.publishPost should be analogous to that of clicking "Publish" on the standard WordPress "Manage" > "Posts" screen.

Creating a draft post in WordPress, then publishing it using mt.publishPost however results in the post having the date of "November 30th, 1999" rather than the current date as it would when using the GUI.

Change History (6)

#1 @josephscott
16 years ago

  • Cc josephscott added

Can you provide the exact contents of the XML-RPC request and response?

#2 @nstech
16 years ago

Please see below:

POST /wordpress/xmlrpc.php HTTP/1.0
Host: server
Content-Type: text/xml
User-Agent: The Incutio XML-RPC PHP Library
Content-length: 260

<?xml version="1.0"?>
<methodCall>
<methodName>mt.publishPost</methodName>
<params>
<param><value><int>27</int></value></param>
<param><value><string>admin</string></value></param>
<param><value><string>admin</string></value></param>
</params></methodCall>

<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<int>27</int>
</value>
</param>
</params>
</methodResponse>

I am using the Incutio XML-RPC PHP Library from http://scripts.incutio.com/xmlrpc/IXR_Library.inc.php.txt

<?php

include "http://scripts.incutio.com/xmlrpc/IXR_Library.inc.php.txt";

// Create the client object
$client = new IXR_Client('http://server/wordpress/xmlrpc.php');
$client->debug=true;
// Run a query for PHP
if (!$client->query('mt.publishPost', 27, 'admin', admin)) {
    die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
}

// Display the result
echo '<pre>';
print_r($client->getResponse());
echo '</pre>';

?>

#3 @josephscott
16 years ago

What we need is the request that created the post. The only thing that mt.publishPost does is to publish an existing post.

#4 @Lazy79
16 years ago

i could fix that by using

<pubDate>
<?php echo mysql2date('r', get_the_time('Y-m-d H:i:s')); ?>
</pubDate>

instead of

<pubDate>
<?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?>
</pubDate>

in feed-rss2.php e.g.

But i do not think that is the right solution, just my workaround for my blogs and maybe i`m totally wrong here.. then sorry of course! ;)

#5 @josephscott
16 years ago

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

I have not be able to reproduce this problem with mt.publishPost, so I'm closing this ticket as invalid. If a method for reproducing this problem is provided then we can re-open it and look into again.

#6 @josephscott
16 years ago

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