mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-01 19:58:57 +08:00
#18683: Fixing blog command switch
Work Item: 18683 --HG-- branch : 1.4.x
This commit is contained in:
parent
daf188c57e
commit
49b7215469
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Commands;
|
||||
@ -39,7 +38,7 @@ namespace Orchard.Blogs.Commands {
|
||||
public string FeedUrl { get; set; }
|
||||
|
||||
[OrchardSwitch]
|
||||
public int Id { get; set; }
|
||||
public int BlogId { get; set; }
|
||||
|
||||
[OrchardSwitch]
|
||||
public string Owner { get; set; }
|
||||
@ -100,7 +99,7 @@ namespace Orchard.Blogs.Commands {
|
||||
|
||||
[CommandName("blog import")]
|
||||
[CommandHelp("blog import /BlogId:<id> /FeedUrl:<feed url> /Owner:<username>\r\n\t" + "Import all items from <feed url> into the blog specified by <id>")]
|
||||
[OrchardSwitches("FeedUrl,Id,Owner")]
|
||||
[OrchardSwitches("FeedUrl,BlogId,Owner")]
|
||||
public void Import() {
|
||||
var owner = _membershipService.GetUser(Owner);
|
||||
|
||||
@ -120,10 +119,10 @@ namespace Orchard.Blogs.Commands {
|
||||
throw new OrchardException(T("An error occured while loading the feed at {0}.", FeedUrl), ex);
|
||||
}
|
||||
|
||||
var blog = _blogService.Get(Id,VersionOptions.Latest);
|
||||
var blog = _blogService.Get(BlogId, VersionOptions.Latest);
|
||||
|
||||
if ( blog == null ) {
|
||||
Context.Output.WriteLine(T("Blog not found with specified Id: {0}", Id));
|
||||
Context.Output.WriteLine(T("Blog not found with specified Id: {0}", BlogId));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user