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

Notification

Icon
Error

jetheredge
#1 Posted : Wednesday, November 1, 2006 10:40:04 AM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

The anthem callbacks appears to be interfering with some of the new code in the URL rewriter. The anthem controls appear to be posting back two ampersands in front of the Anthem_Callback token in the query string. For example /products/product.aspx?id=XXXXX-XXXX-XXXX-XXXXX&&Anthem_Callback=true This is causing the url parser to get a null token in between id and Anthem_Callback. These exceptions were only visible during debugging, which is why we didn't see them. The fix was to add a check for each key to see if it is null.

P.S. Andy, if you see this post, can you tell me if this is normal Anthem behavior, or something that we are doing on our end?
Justin Etheredge
Senior Software Engineer
BVSoftware
Andy Miller
#2 Posted : Wednesday, November 1, 2006 10:45:08 AM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Investigating...
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Andy Miller
#3 Posted : Wednesday, November 1, 2006 12:35:14 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Justin,
I found that BuildPhysicalUrlForCategory and BuildPhysicalUrlForProduct (in UrlRewriter.vb) were adding an ampersand to the end of the rewritten URL. I've modified Anthem to check for a trailing ampersand to avoid adding a null parameter...it will appear in the next Anthem snapshot.



I'd also like to suggest the following versions of BuildPhysicalUrlForCategory and BuildPhysicalUrlForProduct that do not add the trailing ampersand. Note that BuildPhysicalUrlForCategory will not add the additionalParams if there is a custom page assigned to a category. This duplicates (what I think is) the current logic, but I wonder if that is a mistake. It seems like the additionalParams (if any) should be added even if there is a custom page.


Code:

Public Shared Function BuildPhysicalUrlForCategory(ByVal c As Catalog.Category, ByVal additionalParams As String) As String
Dim result As String = String.Empty
If c IsNot Nothing Then
If c.SourceType = Catalog.CategorySourceType.CustomPage Then
If c.CustomPageId <> String.Empty Then
result = "/Custom.aspx?id=" & c.CustomPageId
End If
Else
If c.TemplateName.Trim = String.Empty Then
result = "/BVModules/CategoryTemplates/Bvc5/Category.aspx?categoryid=" & c.Bvin
Else
result = "/BVModules/CategoryTemplates/" & c.TemplateName & "/Category.aspx?categoryid=" & c.Bvin
End If
If Not String.IsNullOrEmpty(additionalParams) Then
If additionalParams.StartsWith("&") Then
result &= additionalParams
Else
result &= "&" & additionalParams
End If
End If
End If
End If
Return result
End Function




Code:

Public Shared Function BuildPhysicalUrlForProduct(ByVal p As Catalog.Product, ByVal additionalParams As String) As String
Dim result As String = String.Empty
If p IsNot Nothing Then
If p.TemplateName.Trim = String.Empty Then
result = "/BVModules/ProductTemplates/Bvc5/Product.aspx?productid=" & p.Bvin
Else
result = "/BVModules/ProductTemplates/" & p.TemplateName & "/Product.aspx?productid=" & p.Bvin
End If
If Not String.IsNullOrEmpty(additionalParams) Then
If additionalParams.StartsWith("&") Then
result &= additionalParams
Else
result &= "&" & additionalParams
End If
End If
End If
Return result
End Function

Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
jetheredge
#4 Posted : Wednesday, November 1, 2006 2:10:38 PM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

I just wanted to know if it was normal Anthem behavior. :smilewinkgrin: But thanks for doing my job for me anyways! Always appreciate a helping hand.
Justin Etheredge
Senior Software Engineer
BVSoftware
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