• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

davebar000
#1 Posted : Thursday, December 27, 2007 10:19:44 AM(UTC)
davebar000

Rank: Member

Joined: 12/30/2006(UTC)
Posts: 65

Hi All,

I've added in Caplinks fix (referenced here: http://forums.bvcommerce...48508&g=48624#m48624)
Some time ago, and it had seemed to work fine when running through testing.

Now that the store is close to going live with products being entered, an error began to surface in a specific situation.
Caplink, If you're available to advise, or anyone else in the group, it would be a huge help at this about-to-launch stage

The error seems to revolve around the Best Category routine.
If we were to navigate into a category listing page, then into the product detail page. All is fine, the category navigation does it's thing.

However, If we access a product right from the Home page, or from the search page, or a product URL directly - WITHOUT - navigating into a category page first.
Then a .net error comes up mentioning "Object reference not set to an instance of an object."

If we back out of the error, then go into a category page. Then from that moment on, everything works fine for that session.
Including clicking through to a product page directly from the homepage or a search (which caused the initial error).

It's almost as if entering a category page... any category page is initializing something that avoids the error.

My first instinct was that the client didn't assign categories to the products when entering, but when checking via the admin, the categories are appearing.

I'll paste the error code below.
Has anyone else experienced this and fixed?

I'm guessing that the error is happening because it's not able to assign a best category for some reason (I suppose if there are multiple assigned and we're jumping to the page).
Is it possible to force a specific category (like a generic "specials" category I can create to work around the error)?

Caplink, if you're available to advise it would be a huge help.

Thanks All
-Dave

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 46: Else
Line 47: Dim bestCat As Catalog.Category = FindMaxDepthCategory(Catalog.InternalProduct.GetCategories(DirectCast(Me.Page, BaseStoreProductPage).LocalProduct.Bvin), 0, 0, Nothing)
Line 48: Catalog.Category.FindByBvin(bestCat.Bvin).FindParentsToRoot(_currentCategories)
Line 49: currentId = bestCat.Bvin
Line 50: End If


Source File: D:\Domains\nycpet.com\wwwroot\BVModules\ContentBlocks\Category Menu\view.ascx.vb Line: 48

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
BVModules_ContentBlocks_Category_Menu_view.LoadMenu() in D:\Domains\nycpet.com\wwwroot\BVModules\ContentBlocks\Category Menu\view.ascx.vb:48
BVModules_ContentBlocks_Category_Menu_view.Page_Load(Object sender, EventArgs e) in D:\Domains\nycpet.com\wwwroot\BVModules\ContentBlocks\Category Menu\view.ascx.vb:18
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
davebar000
#2 Posted : Thursday, December 27, 2007 11:07:35 AM(UTC)
davebar000

Rank: Member

Joined: 12/30/2006(UTC)
Posts: 65

Quick Followup:

Here's the added portion of code for the fix:
' CapLink Modification
If TypeOf Me.Page Is BaseStoreProductPage Then
If currentId IsNot "0" Then
Catalog.Category.FindByBvin(currentId).FindParentsToRoot(_currentCategories)
'Else
' Dim bestCat As Catalog.Category = FindMaxDepthCategory(Catalog.InternalProduct.GetCategories(DirectCast(Me.Page, BaseStoreProductPage).LocalProduct.Bvin), 0, 0, Nothing)
' Catalog.Category.FindByBvin(bestCat.Bvin).FindParentsToRoot(_currentCategories)
' currentId = bestCat.Bvin
End If
'_currentCategories = Catalog.InternalProduct.GetCategories(DirectCast(Me.Page, BaseStoreProductPage).LocalProduct.Bvin)
ElseIf currentId IsNot "0" Then
Catalog.Category.FindByBvin(currentId).FindParentsToRoot(_currentCategories)
Else

End If
' End CapLink Modification


I commented out the first ELSE statement.
That let's the product page come up without error.
But it opens the category navigation to whatever the last active category was.
Turns out, that is what was happening when I was getting the error in the first message, and then went into a category (thinking then I cleared out the error somehow)

So if I surf to a product via the category detail, then everything is normal
(Category Dogs, sub category Canned Food for example).

Then if I search
And click a product from the search results (essentially going directly to the product page without surfing through a category page).
Then the category navigation will show whatever the last sub category listing page was, not what category the product is truly assigned.
Meaning, I can choose to jump right to a product page that is Category Birds, and Sub Category seed... but the category navigation will still show Category Dogs, Sub Category Canned Food.

And will remain that way until I click through to any other category listing page.

I would rather have the category menu display completely closed, instead of the wrong category.

so unfortunately, commenting out the Best Category ELSE statement isn't the answer.

Thanks again for any help
-Dave

Thanks again for any help
davebar000
#3 Posted : Tuesday, January 1, 2008 8:56:14 PM(UTC)
davebar000

Rank: Member

Joined: 12/30/2006(UTC)
Posts: 65

Just a respectful check in and request for review.
Site should be launching, but needs to hold for the fix.

Removing the category menu "current" fix takes away what I would expect to be a common feature (Category menu matching the produce being reviewed).

If any of the .net guru's can lend a hand or advice in troubleshooting, it would be a huge help.

Thanks
-Dave
[email protected]
#4 Posted : Tuesday, January 1, 2008 9:35:15 PM(UTC)
sales@rudystoys.com

Rank: Member

Joined: 11/13/2004(UTC)
Posts: 189

Hello,
Try resposio.com ...
I use them and they are fantastic...
my $.02
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012