Fixing how tags are updated using XmlRpc

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-10-02 09:45:50 -07:00
parent ba4317f221
commit 9cc218aa0e
2 changed files with 6 additions and 16 deletions

View File

@@ -23,8 +23,7 @@ namespace Orchard.Core.Common.Services {
switch (context.Request.MethodName) {
case "metaWeblog.newPost":
MetaWeblogSetCustomCreatedDate(
GetId(context.Response),
Convert.ToString(context.Request.Params[0].Value),
Convert.ToInt32(context.Request.Params[0].Value),
Convert.ToString(context.Request.Params[1].Value),
Convert.ToString(context.Request.Params[2].Value),
(XRpcStruct) context.Request.Params[3].Value,
@@ -33,8 +32,7 @@ namespace Orchard.Core.Common.Services {
break;
case "metaWeblog.editPost":
MetaWeblogSetCustomCreatedDate(
GetId(context.Response),
Convert.ToString(context.Request.Params[0].Value),
Convert.ToInt32(context.Request.Params[0].Value),
Convert.ToString(context.Request.Params[1].Value),
Convert.ToString(context.Request.Params[2].Value),
(XRpcStruct) context.Request.Params[3].Value,
@@ -44,7 +42,7 @@ namespace Orchard.Core.Common.Services {
}
}
private void MetaWeblogSetCustomCreatedDate(int contentItemId, string appKey, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
private void MetaWeblogSetCustomCreatedDate(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
if (!publish)
return;

View File

@@ -60,8 +60,7 @@ namespace Orchard.Tags.Services {
break;
case "metaWeblog.newPost":
MetaWeblogUpdateTags(
GetId(context.Response),
Convert.ToString(context.Request.Params[0].Value),
Convert.ToInt32(context.Request.Params[0].Value),
Convert.ToString(context.Request.Params[1].Value),
Convert.ToString(context.Request.Params[2].Value),
(XRpcStruct)context.Request.Params[3].Value,
@@ -70,8 +69,7 @@ namespace Orchard.Tags.Services {
break;
case "metaWeblog.editPost":
MetaWeblogUpdateTags(
GetId(context.Response),
Convert.ToString(context.Request.Params[0].Value),
Convert.ToInt32(context.Request.Params[0].Value),
Convert.ToString(context.Request.Params[1].Value),
Convert.ToString(context.Request.Params[2].Value),
(XRpcStruct)context.Request.Params[3].Value,
@@ -113,12 +111,6 @@ namespace Orchard.Tags.Services {
: null;
}
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 XRpcArray MetaWeblogGetTags(string appKey, string userName, string password) {
var user = _membershipService.ValidateUser(userName, password);
_authorizationService.CheckAccess(StandardPermissions.AccessAdminPanel, user, null);
@@ -139,7 +131,7 @@ namespace Orchard.Tags.Services {
return array;
}
private void MetaWeblogUpdateTags(int contentItemId, string appKey, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
private void MetaWeblogUpdateTags(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection<IXmlRpcDriver> drivers) {
var user = _membershipService.ValidateUser(userName, password);
var rawTags = content.Optional<string>("mt_keywords");