Fixing Remote Blog Post publishing

A new blog post containing tags could not be processed

--HG--
branch : 1.x
extra : rebase_source : 8816df6c0a1077d702161d0a71469d1985d9a37c
This commit is contained in:
Sebastien Ros
2012-10-15 10:58:22 -07:00
parent cca88356d4
commit a1910c7521

View File

@@ -60,7 +60,7 @@ namespace Orchard.Tags.Services {
break;
case "metaWeblog.newPost":
MetaWeblogUpdateTags(
Convert.ToInt32(context.Request.Params[0].Value),
GetId(context.Response), // for a new Post, the id is in the Response, as the request contains the blogId
Convert.ToString(context.Request.Params[1].Value),
Convert.ToString(context.Request.Params[2].Value),
(XRpcStruct)context.Request.Params[3].Value,
@@ -79,6 +79,12 @@ namespace Orchard.Tags.Services {
}
}
private static int GetId(XRpcMethodResponse response) {
return response != null && response.Params.Count == 1 && response.Params[0].Value is int
? Convert.ToInt32(response.Params[0].Value)
: 0;
}
private void MetaWeblogAttachTagsToPost(XRpcStruct postStruct, int postId, string userName, string password, ICollection<IXmlRpcDriver> drivers) {
if (postId < 1)
return;