[TxMt] Blogging bundle patch for Wordpress error

Michael Jackson mjijackson at gmail.com
Fri May 18 05:57:08 UTC 2007


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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2452 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070517/0c7a4de0/attachment.p7s>


More information about the textmate mailing list