Hello all,
When I try to run the patch documented at http://macromates.com/wiki/ Blogging/WordPress, I get the following error:
burt:~/Desktop michael$ patch < wp-xmlrpc-mw-gmt-patch patching file xmlrpc.php Hunk #1 FAILED at 669. Hunk #2 FAILED at 740. 2 out of 2 hunks FAILED -- saving rejects to file xmlrpc.php.rej
I'm assuming this means that my file is not patched correctly. I'm running the latest Wordpress (2.2) but I'm not aware of any changes that were made to the xmlrpc.php file from previous versions. Here is what comes up in the xmlrpc.php.rej file (sorry for all the code)...
*************** *** 669,675 ****
if ($postdata['post_date'] != '') {
- $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
$categories = array(); $catids = wp_get_post_cats('', $post_ID); --- 669,686 ----
if ($postdata['post_date'] != '') {
+ /* BEGIN PATCH */ + /* Convert post_date to GMT so receiving applications can + safely adjust it to the user's local time zone. + Using post_date_gmt instead of post_date does *not* work, + since it is (wrongly) adjusted for the gmt_offset *twice*. */ + /* Old code: + $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']); */ + $post_date = mysql2date('Y-m-d H:i:s', $postdata['post_date']); + $post_date = get_gmt_from_date($post_date); + $post_date = str_replace('-', '', $post_date); + $post_date = str_replace(' ', 'T', $post_date); + /* END PATCH */
$categories = array(); $catids = wp_get_post_cats('', $post_ID); *************** *** 729,736 **** }
foreach ($posts_list as $entry) { - - $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); $categories = array(); $catids = wp_get_post_cats('', $entry['ID']); foreach($catids as $catid) { --- 740,759 ---- }
foreach ($posts_list as $entry) { + + /* BEGIN PATCH */ + /* Convert post_date to GMT so receiving applications can + safely adjust it to the user's local time zone. + Using post_date_gmt instead of post_date does *not* work, + since it is (wrongly) adjusted for the gmt_offset *twice*. */ + /* Old code: + $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); */ + $post_date = mysql2date('Y-m-d H:i:s', $entry['post_date']); + $post_date = get_gmt_from_date($post_date); + $post_date = str_replace('-', '', $post_date); + $post_date = str_replace(' ', 'T', $post_date); + /* END PATCH */ + $categories = array(); $catids = wp_get_post_cats('', $entry['ID']); foreach($catids as $catid) {
Can anybody diagnose this problem? I would appreciate it very much.
Thanks!
Michael
P.S. Great work on the blogging bundle! I love it!
On 18. May 2007, at 07:57, Michael Jackson wrote:
[...] When I try to run the patch documented at http://macromates.com/ wiki/Blogging/WordPress, I get the following error: [...] I'm assuming this means that my file is not patched correctly. I'm running the latest Wordpress (2.2) but I'm not aware of any changes that were made to the xmlrpc.php file from previous versions.
You can try “svn log xmlrpc.php” to see if it has changed.
Coincidentally I was recently in contact with a WordPress maintainer who had done work on WordPress XML-RPC and told me they have done both new features and bug fixes for the upcoming 2.2 -- so my guess would be the file has been changed (too much) since Brett did the patch.
On May 18, 2007, at 6:28 AM, Allan Odgaard wrote:
On 18. May 2007, at 07:57, Michael Jackson wrote:
[...] When I try to run the patch documented at http://macromates.com/ wiki/Blogging/WordPress, I get the following error: [...] I'm assuming this means that my file is not patched correctly. I'm running the latest Wordpress (2.2) but I'm not aware of any changes that were made to the xmlrpc.php file from previous versions.
You can try “svn log xmlrpc.php” to see if it has changed.
Coincidentally I was recently in contact with a WordPress maintainer who had done work on WordPress XML-RPC and told me they have done both new features and bug fixes for the upcoming 2.2 -- so my guess would be the file has been changed (too much) since Brett did the patch.
Upon further investigation, I've found that you're absolutely right. It appears that they (the WordPress team) has tried to fix the issue themselves with v. 2.2. The old patch used to change the following line (of version 2.1):
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']);
to this:
$post_date = mysql2date('Y-m-d H:i:s', $postdata['post_date']); $post_date = get_gmt_from_date($post_date); $post_date = str_replace('-', '', $post_date); $post_date = str_replace(' ', 'T', $post_date);
However, in version 2.2, the line now looks like this:
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
I don't have access to an old copy of the database, so I don't know exactly what the difference is between the 'post-date' and 'post-date- gmt' values, but I'm guessing that it means that the conversion using the get_gmt_from_date function is no longer necessary.
Also, I've found that the blogging bundle Comments and Pings headers are broken in WordPress. If I try and edit a post that has Comments and Pings turned on, they will always be turned off whenever I commit the revised post, no matter what the headers say.
Sorry about all the bother. I just wanted to let you know that the blogging bundle is having issues with WordPress 2.2. Other than that, keep up the great work on the blogging bundle!
Thanks,
Michael
On 18. May 2007, at 17:14, Michael Jackson wrote:
[...] However, in version 2.2, the line now looks like this:
$post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']);
I don't have access to an old copy of the database, so I don't know exactly what the difference is between the 'post-date' and 'post- date-gmt' values, but I'm guessing that it means that the conversion using the get_gmt_from_date function is no longer necessary.
If you open the xmlrpc.php file in TextMate and selects Subversion → Blame then you can hoover the mouse on teh revision number shown in the left column to see the log message for that revision :) Of course you can also just read the full log for the file. Maybe that will clear up why they changed what they did etc.
Also, I've found that the blogging bundle Comments and Pings headers are broken in WordPress. If I try and edit a post that has Comments and Pings turned on, they will always be turned off whenever I commit the revised post, no matter what the headers say.
What if you remove them?
Sorry about all the bother. I just wanted to let you know that the blogging bundle is having issues with WordPress 2.2. Other than that, keep up the great work on the blogging bundle!
Ideally problems with a certain blogging system should be reported to the maintainers of that blogging system, especially if it’s only a particular version of their system which causes problems.