#6483 closed defect (bug) (invalid)
Using mt.publishPost results in posts having date of November 30th, 1999
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | XML-RPC | Version: | 2.3.3 |
| Severity: | minor | Keywords: | mt.publishPost publishPost xmlrpc |
| Cc: | josephscott |
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)
comment:1
josephscott
— 5 years ago
- Cc josephscott added
comment:2
nstech
— 5 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>';
?>
comment:3
josephscott
— 5 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.
comment:4
Lazy79
— 5 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! ;)
comment:5
josephscott
— 5 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.
comment:6
josephscott
— 5 years ago
- Milestone 2.7 deleted
Can you provide the exact contents of the XML-RPC request and response?