Fixing the search page w/ no query

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-01 00:01:24 -07:00
parent d34cae6ac4
commit 6111dbb786

View File

@@ -40,11 +40,10 @@ namespace Orchard.Search.Controllers {
protected virtual ISite CurrentSite { get; [UsedImplicitly] private set; }
public ActionResult Index(string q, Pager pager) {
public ActionResult Index(Pager pager, string q = "") {
var searchFields = CurrentSite.As<SearchSettingsPart>().SearchedFields;
IPageOfItems<ISearchHit> searchHits;
if (q.Trim().StartsWith("?") || q.Trim().StartsWith("*")) {
searchHits = new PageOfItems<ISearchHit>(new ISearchHit[] { });
Services.Notifier.Error(T("'*' or '?' not allowed as first character in WildcardQuery"));