Nomoa.com

Paving the way for .NET in Tonga

Categories
Main Menu
Subscribe to Our RSS Feed Subscribe to Comments Feed Signup for MSN Alerts to Nomoa.com: Articles Signup for Yahoo Alerts to Nomoa.com :: News Articles
Google Ads
Publication : News Articles (1787) - Pictures (262) - Web Links (40) - Downloads (15)
Mind Dumps Go Here + A MoveableType API Post Publisher that I'm working on, and learning from.
Browse in : All > Soap Box
All > Soap Box > bTonga
Any of these categories - All of these categories

patch for WordPress 2.0 (December tar release)

Soap Box
Posted by: Samiuela LV Taufa on January 09, 2006 5:31:11 PM

There is a problem with WordPress 2.0 and support for XML file uploads (using MetaweblogAPI NewMediaObject)

As I understand the error, and my whacked solution, the 1st part of the error seems to be an innocuous typing mistake. (i.e. uploads instead of upload [without the 's']) The 2nd part, I'm not too sure of, but things do work when adding a false value to 'error'.

I hope this helps those with WordPress 2.0 and errors with their blog clients.

 

Visit bTonga

Note: Looking at the "trunk" latest code on their server, it seems the problem has been picked up earlier and I just missed on getting the 'old' code.

--- functions-post.php-org Mon Dec 26 10:16:27 2005
+++ functions-post.php Mon Jan  9 15:10:45 2006
@@ -894,7 +894,7 @@
  while ( file_exists($upload['path'] . "/$filename") )
   $filename = str_replace("$number.$ext", ++$number . ".$ext", $filename);
 
- $new_file = $uploads['path'] . "/$filename";
+ $new_file = $upload['path'] . "/$filename";
  $ifp = @ fopen($new_file, 'wb');
  if ( ! $ifp )
   return array('error' => "Could not write file $new_file.");
@@ -909,7 +909,7 @@
  // Compute the URL
  $url = $upload['url'] . "/$filename";
 
- return array('file' => $new_file, 'url' => $url);
+ return array('file' => $new_file, 'url' => $url, 'error' => false);
 }
 
 ?>

There are no comments attached to this item.


Options :
View Article Map
Log In to Contribute
View Archives