I have an Ecommerce site where I have used the AddToCart widget in Product listing views. After upgrading to 5.3 all these pages produces an error:
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.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.AddToCartWidget.InitializeControls(GenericContainer container) +19
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4200
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
When I comment out the AddToCartWidget the page renders just fine.
I just can't see what's changed since 5.2 to create this error.
Anyone with any insights into this?
We have tested upgrades regarding the Ecommerce module and haven't got an issue like that. I think it is specific problem for your project but to find the bug more information is needed as Jochem said. Could you provide us with the upgrade log in order to get the upgrade error if any. Can you share more details about your project? Is it Multilingual? Have you done any custom development? Any information would be helpful.
If you can send us you project and database in support ticket we will be able to easily locate the issue.
Have done a client 5.2 upgrade without any problems (no BuyNow widgets, standard shippable products) and after reading your post also took a 5.2.3700 test site with BuyNow widgets and upgraded it and it seems to function without any problem.
The test-site I played with uses the BuyNow widget with a normal generic product, perhaps you're using variations? Localized? Or some special form of Attributes that may cause issues?
I'd be more than happy to re-upgrade the test-site to verify the bug...
We will continue helping you with this service request in the support ticket you have submitted.
was there a solution? Because I have the same problem...
I've just run on 5.2 so far. But I picked up this again two days ago, and the support team have now my projects and databases for investigation. They have not replyed yet, but I'll update the thred with their findings.
It is very strange, but I think it must have something to do with the inventory. That's the only new thing in 5.3. I'm not using it, I have my own inventory from my backend system.
thank you for your reply. Here the same situation, don't use the inventory... simple scenario.
Also an upgrade to 5.4 doesn't fix the issue.
Is it possible to keep us informed through the forum? Thanks in advance...
Bob / Ole,
Call me an idiot, but I'd love to try and find out what's causing it - any change either of you is willing to toss a broken project my way ?
not at all... :)
but I'm afraid I can't give you the project... I'll see if I can reproduce the problem...
I'll PM you on LinkedIn with download and login credentials.
Thanks, I've got it up and running - send you an email with the details so far.
I found a (hopefully temporary) workaround...
I inherited the AddToCartWidget and removed some checks:
CustomAddToCartWidget : AddToCartWidget
sender, CommandEventArgs e)
IShoppingCartAdder shoppingCartAdder = (IShoppingCartAdder)
defaultCurrency = Config.Get<EcommerceConfig>().DefaultCurrency;
OptionsDetails optionDetails = GetOptionDetails();
.Product, optionDetails, quantity, defaultCurrency,
List<ProductVariationDetail> variationDetails =
Enumerable.ToList<ProductVariation>(Enumerable.Select<ProductVariationDetail, ProductVariation>((IEnumerable<ProductVariationDetail>)variationDetails, (Func<ProductVariationDetail, ProductVariation>)(pvd => pvd.ProductVariationParent)));
Control parent =
OptionsDetails optionsDetails =
And used this control in my template.
For the moment this seems to work, but I'll have to map this to a new template to modify some markup. Some issues with the validators.