Paving the way for .NET in Tonga
| Browse in : |
All
> Soap Box
All > Soap Box > Low No Cost Tech Any of these categories - All of these categories |
Been having a problem the last couple of days and I've finally tracked down the root cause/effect to the problem, although I have yet to figure out who is actually at fault so I can submit a proper bug.
1. Add a Dynamic Data Field - xarTinyMCE GUI to Article News PubType
2. Submit/Edit an entry from a desktop client through metaweblogapi newpost/editpost.
NewPost|EditPost fails with xmlresponse from the server returning the following:
My Code Noted Error Message:
NewPost Dynamic Data and xmlrpc - failed
Response from server does not contain valid XML.
There are multiple root elements. Line 2, position 2.Response from Server
<br />
<b>Notice</b>: Undefined index: in <b>./modules/xmlrpcserver/xarincludes/xmlrpc.inc</b> on line <b>826</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at ./modules/xmlrpcserver/xarincludes/xmlrpc.inc:826) in <b>./modules/xmlrpcserver/xarincludes/xmlrpcs.inc</b> on line <b>78</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at ./modules/xmlrpcserver/xarincludes/xmlrpc.inc:826) in <b>./modules/xmlrpcserver/xarincludes/xmlrpcs.inc</b> on line <b>79</b><br />
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<int>1600</int>
Partial completion of task has been achieved. (a) Article has been successfully submitted. Unfortunately (at least using MoveableType API) the category and keywords have not been set.
Remove the Dynamic Data Field from the pubtype.
How to duplicate the problem.
1. Edit the Article News Pubtype and add a Dynamic Data Field of Property Type "TinyMCE GUI Editor" (Problem will occur if Status is "Active" or "Hidden", problem does not occur if Status is "Display Only.")
2. Create a NewPost or EditPost from an xmlrpc metaweblogapi/moveabletype client.
What tracing (little) information I have found.
a. When you do an xmlrpc call to metaweblogapi.newpost/editpost somewhere in that function call is a call to modules/articles/xaradminapi/create.php or update.php.
b. xarModCallHooks('item', 'create', $aid, $args); is called to update the Hooks with either 'create' or 'update'
c. When the hooks eventually get to Dynamic Data it eventually gets to modules/dynamicdata/xaradminapi/updatehook.php
d. In this api processes, and there is a validation failure:
$myobject->getItem();
// use the values passed via $extrainfo if available
$isvalid = $myobject->checkInput($extrainfo);
if (!$isvalid) {
The validation failure leads an exception being set
xarErrorSet(XAR_USER_EXCEPTION, 'BAD_DATA', new DefaultUserException($msg));
The above generates the following log entry
Logged error: code: 1 BAD_DATA | Invalid input for admin function updatehook() in module dynamicdata :
5. calls eventually return to newpost|editpost, which not noting the exception calls xmlrpcserver/xaruserapi/createresponse.php as a success
6. After module call, the Exception handler kicks in, noted by the below entries in the log file.
[DEBUG] Using template : modules/xmlrpcserver/xartemplates/xmlrpc-createresponse.xd
[DEBUG] Using template : modules/xmlrpcserver/xartemplates/includes/xmlrpc-types.xd
[WARNING] Issuing errorno 800: User Error: Bad Data: The data provided was bad.
I am drawing the conclusion that the xmlrpc response is corrupted during this exception handling process.
I'm not sure whether this error should be handled in the updatehook or in the exception handler or in xmlrpc.
Visit bTonga
There are no comments attached to this item.