XMLRPC value_calculate_type throws exception

boombatower - April 12, 2008 - 22:59
Project:Drupal
Version:7.x-dev
Component:blogapi.module
Category:bug report
Priority:normal
Assigned:boombatower
Status:closed
Description

As noted in http://drupal.org/node/245955 the code throws a warning when the following code in executed.

<?php
$result
= xmlrpc($local, 'metaWeblog.newMediaObject', $blog_id, $web_user->name, $web_user->pass_raw, $file);
?>

Exception:

Unexpected PHP error [Undefined property: stdClass::$is_date] severity [E_NOTICE] in [~/includes/xmlrpc.inc line 70]

#1

boombatower - May 15, 2008 - 02:15

Anyone know if the object was changed or something?

#2

boombatower - June 26, 2008 - 06:14
Assigned to:Anonymous» boombatower
Status:active» patch (code needs review)

Alright this is a simple issue with a simple fix, just depended on how to do it.

I wrapped the is_* type checks with isset() since they are only set when it is that type rather than always setting the attribute.

Tested BlogAPI test and passes without exception!

AttachmentSize
xmlrpc-type-checks.patch818 bytes

#3

Dries - June 26, 2008 - 11:44

I can't really test this patch until XML-RPC tests work again.

Looking at the code, this certainly looks RTBC.

#4

boombatower - June 26, 2008 - 21:10

Ok #274994: Simpletest not including tests includes directory was just committed and tests should run, although the xmlrpc test is still broken, due to test issues.

This patch fixes exceptions in Blog API test though.

#5

boombatower - June 26, 2008 - 23:18

#6

Dries - June 27, 2008 - 07:26
Status:patch (code needs review)» fixed

Fixes the tests. Committed to CVS HEAD.

#7

Anonymous (not verified) - July 11, 2008 - 07:34
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.