Notice that the default for each attribute is the text string "null". When the macro view attempts to validate these attributes, it checks for a null value rather than a string with the value "null". Of course, the results did not display without tweaking the macro partial to account for this.
Here is an example of my fix for the queryType attribute:
FullTextSearch.cshtml does not check for "null" string
Using the macro tool in the RTE, I added the FullTextSearch macro with default settings. In Umbraco 7.2.1, this creates code that looks like this:
<?UMBRACO_MACRO macroAlias="FullTextSearch" queryType="null" titleProperties="null" bodyProperties="null" summaryProperties="null" titleLinkProperties="null" rootNodes="null" contextHighlighting="0" summaryLength="null" pageLength="null" fuzzyness="null" useWildcards="0" />
Notice that the default for each attribute is the text string "null". When the macro view attempts to validate these attributes, it checks for a null value rather than a string with the value "null". Of course, the results did not display without tweaking the macro partial to account for this.
Here is an example of my fix for the queryType attribute:
var queryType = String.IsNullOrEmpty(Parameter.queryType) || Parameter.queryType == "null" ? "MultiRelevance" : Parameter.queryType;
In this example, I added the line: || Parameter.queryType == "null" to check for string values of null.
is working on a reply...