I tried the search and I got the following error message:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 20: Examine.SearchCriteria.ISearchCriteria filter = null;
Line 21: string searchTerm = "";
Line 22: results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList();
Line 23: }
Line 24: else
That's odd, I did notice a problem with the search on a clients website earlier. I'm afraid I won't have a chance to look at it today unfortunately. I'll have a look at it tomorrow for you if that's okay?
It could well be, the search seems to work well when i run the website directly from visual studio. Could I ask what the address is of the website your building? It might be something simple enough.
I tried the search running from Visual Studio and that's when I got the error. I put the Umbraco site on a testing server and the blog is not working at all currently: http://umbracotest.konverge.com/konverge-blog/. Looking into that....would I have to reinstall the package?
To fix the search, I could create a zip file which you would just have to unpack into the root directory of your website.
However the URL you have provided shows a server side error. Could I ask how you published the website? I find that sometimes when publishing an Umbraco 7 website, the global.asax file does not get copied and so the website breaks.
From memory, the search is handled via JS, it redirects you to the search results page with a query string on the end, can you check if the JS is running?
Hi Luke / Christine - Did you ever find a solution for this error? I tried creating new projects in VS and WebMatrix on two different servers and keep getting this error.
Hi Luke, it occurs on my local development environment.
Steps:
1. download and install Umbraco via visual studio / nuget.
2. install smartblog package.
3. publish content nodes.
4. browse to site and search.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 19: Examine.SearchCriteria.ISearchCriteria filter = null;
Line 20: string searchTerm = "";
Line 21: results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList();
Line 22: }
Line 23: else
Error message when using search
Hi luke,
I tried the search and I got the following error message:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 20: Examine.SearchCriteria.ISearchCriteria filter = null; Line 21: string searchTerm = ""; Line 22: results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList(); Line 23: } Line 24: else
Source File: c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\Partials\SmartListPosts.cshtml Line: 22
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009
Hi Christine,
That's odd, I did notice a problem with the search on a clients website earlier. I'm afraid I won't have a chance to look at it today unfortunately. I'll have a look at it tomorrow for you if that's okay?
Thanks, Luke
That would be great! Maybe this is a local host issue? I am planning to move the site to a testing server today.
It could well be, the search seems to work well when i run the website directly from visual studio. Could I ask what the address is of the website your building? It might be something simple enough.
I tried the search running from Visual Studio and that's when I got the error. I put the Umbraco site on a testing server and the blog is not working at all currently: http://umbracotest.konverge.com/konverge-blog/. Looking into that....would I have to reinstall the package?
To fix the search, I could create a zip file which you would just have to unpack into the root directory of your website.
However the URL you have provided shows a server side error. Could I ask how you published the website? I find that sometimes when publishing an Umbraco 7 website, the global.asax file does not get copied and so the website breaks.
My apologies - the url is only available internally or by vpn
This is what I see when I view the blog:
The Umbraco site was published from Visual Studio and copied onto the server.
It's a possibility that the site hasn't been copied correctly. You might want to confirm that all the files exist on the live server.
Thanks - you're right. Some files didn't get published. That is resolved now.
Regarding the search - there is no error message on the server, it just does not do anything.
From memory, the search is handled via JS, it redirects you to the search results page with a query string on the end, can you check if the JS is running?
Hi Luke - The Main.Smartblog.js is running without any errors.
Hi Luke / Christine - Did you ever find a solution for this error? I tried creating new projects in VS and WebMatrix on two different servers and keep getting this error.
Hi Punit,
Does the error occur only after publishing the site?
Thanks, Luke
Hi Luke, it occurs on my local development environment. Steps: 1. download and install Umbraco via visual studio / nuget. 2. install smartblog package. 3. publish content nodes. 4. browse to site and search.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 19: Examine.SearchCriteria.ISearchCriteria filter = null; Line 20: string searchTerm = ""; Line 21: results = SmartBlogLibraries.Helpers.Search.SearchBlog(out filter, out searchTerm).Select(x => ((IPublishedContent)Umbraco.Content(x.Id))).ToList(); Line 22: } Line 23: else
Source File: c:\inetpub\smartblog\smartblog\Views\Partials\SmartListPosts.cshtml Line: 21
is working on a reply...