Windows Live Writer BlogAPI Error

mcload - February 9, 2009 - 09:34
Project:Windows Live Writer BlogAPI
Version:6.x-1.4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I see this problem at both core's BlogAPI and Windows Live Writer BlogAPI. I wrote BlogAPI's error report to http://drupal.org/node/370893 . This post gives details on Live Writer BlogAPI's error.

I am trying to use Windows Live Writer 14. However, when I try to publish, Live Writer is giving the error "The response to the metaWeblog.newPost method received from the blog server was invalid: Invalid response document returned from XmlRpc server".

I checked the error log and saw that Drupal is sending the error message "__clone method called on non-object in C:\Project\drupal\includes\common.inc on line 1685".

Watchdog's log in the database is as follows:

1023 1 user Session opened for %name. a:1:{s:5:"%name";s:5:"Al";} 5 http://localhost/drupal/xmlrpc.php 127.0.0.1 1234058798

I used Trace to find the error source. Its log is as follows:

#3a8cb525 T=0.000000 [REQUEST] 2009-02-08 10:21:44.833964 POST /drupal/xmlrpc.php HTTP/1.1
#3a8cb525 T+0.005704 [HOOK ] hook_boot: devel
#3a8cb525 T+0.007843 [HOOK ] hook_xmlrpc: wlw_blogapi
#3a8cb525 T+0.011909 [HOOK ] hook_user: block, blog, comment, contact, dblog, locale, node, openid, poll, profile, statistics, system, trigger, user, userreference, date_timezone, googleanalytics, imagecache, imagecache_profiles, wysiwyg, pathauto, i18n, drupalforfirebug
#3a8cb525 T+0.029094 [HOOK ] hook_watchdog: dblog, syslog
#3a8cb525 T+0.030729 [HOOK ] hook_user: block, blog, comment, contact, dblog, locale, node, openid, poll, profile, statistics, system, trigger, user, userreference, date_timezone, googleanalytics, imagecache, imagecache_profiles, wysiwyg, pathauto, i18n, drupalforfirebug
#3a8cb525 T+0.039585 [HOOK ] hook_db_rewrite_sql: node, i18nblocks, i18n, i18ntaxonomy
#3a8cb525 T+0.045126 [NOTICE ] E_NOTICE: Undefined variable: tags in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':858
$node->taxonomy = array('tags' => $tags);
#3a8cb525 T+0.047133 [NOTICE ] E_NOTICE: Undefined index: mt_excerpt in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':900
if ($struct['mt_excerpt']) {
#3a8cb525 T+0.049057 [NOTICE ] E_NOTICE: Undefined index: mt_convert_breaks in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':908
if ($struct['mt_convert_breaks']) {
#3a8cb525 T+0.050973 [NOTICE ] E_NOTICE: Undefined index: dateCreated in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':913
if ($struct['dateCreated']) {
#3a8cb525 T+0.053079 [NOTICE ] E_NOTICE: Uninitialized string offset: 1 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.055016 [NOTICE ] E_NOTICE: Uninitialized string offset: 2 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.057074 [NOTICE ] E_NOTICE: Uninitialized string offset: 3 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.059054 [NOTICE ] E_NOTICE: Uninitialized string offset: 4 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.061032 [NOTICE ] E_NOTICE: Uninitialized string offset: 5 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.062959 [NOTICE ] E_NOTICE: Uninitialized string offset: 6 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.064874 [NOTICE ] E_NOTICE: Uninitialized string offset: 7 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.066786 [NOTICE ] E_NOTICE: Uninitialized string offset: 8 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.068698 [NOTICE ] E_NOTICE: Uninitialized string offset: 9 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.070746 [NOTICE ] E_NOTICE: Uninitialized string offset: 10 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.072795 [NOTICE ] E_NOTICE: Uninitialized string offset: 11 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.074988 [NOTICE ] E_NOTICE: Uninitialized string offset: 12 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.077442 [NOTICE ] E_NOTICE: Uninitialized string offset: 13 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.079840 [NOTICE ] E_NOTICE: Uninitialized string offset: 14 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.082112 [NOTICE ] E_NOTICE: Uninitialized string offset: 15 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.084139 [NOTICE ] E_NOTICE: Uninitialized string offset: 16 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.086228 [NOTICE ] E_NOTICE: Uninitialized string offset: 17 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.089921 [NOTICE ] E_NOTICE: Uninitialized string offset: 18 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.092085 [NOTICE ] E_NOTICE: Uninitialized string offset: 19 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.094206 [NOTICE ] E_NOTICE: Uninitialized string offset: 20 in `sites\all\modules\wlw_blogapi\wlw_blogapi.module':931
$temp[] = $title2[$i];
#3a8cb525 T+0.096470 [RESPNSE] 2009-02-08 10:21:44.929117 200 OK

#1

jrglasgow - September 2, 2009 - 17:19

When the server has E_NOTICE turned on every little thing like checking the value of an uninitialized variable throws a notice.

The is especially harmful when the expected result for the page request is to be parsed by a program that is not very good at ignoring notices that break the expected syntax of the XML it is expecting to receive.

The module was checking the value of a couple of possibly uninitialized variables in this function and causing notices to be thrown.

I have changed the function to use the empty() function which

empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set.

FYI - production site should never have E_NOTICE set.

#2

jrglasgow - September 2, 2009 - 17:20
Status:active» fixed

#3

System Message - September 16, 2009 - 17:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.