Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Caractacus Downes 81 posts 314 karma points
    Oct 13, 2016 @ 13:24
    Caractacus Downes
    0

    Merchello Billing / Postage Address State validation

    Hi,

    I've found a problem in the check out stage of Merchello / Fastrack (2.2.1). If the State / Province / Region field is left empty for countries where a list of possible values isn't included in the merchello.config file then I get the following error when trying to get to the ShipRateQuote page:

    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 6:  <!-- ShipRateQuote.cshtml -->
    Line 7:  
    Line 8:  @Html.Action("ShipRateQuoteForm", "CheckoutShipRateQuote", new { area = "FastTrack" })
    

    So to fix this I either need to make the State / Province / Region required by adding it to the validation routine, or I need to modify the bit of code that is falling over if it finds the State / Province / Region field contains an empty string.

    I can't work out how to do either of those things at the moment. Can anyone help?

    Alternatively if I've misdiagnosed the problem any other suggestions would be helpful too ...

    Cheers,

    Crac

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Oct 13, 2016 @ 14:03
    Simon Dingley
    0

    I think this issue was fixed in v2.3.0

    http://issues.merchello.com/youtrack/issue/M-1104

    I also posted some sample code on there that I had to use to work around it but its not specific to FastTrack but may help you.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 13, 2016 @ 16:03
    Rusty Swayne
    0

    Yes - the error was fixed, but it may be we need to look at the validation again. The trick though is it is different for various people. e.g. in the US we always want the state (region) whereas in other places the region is optional.

  • Caractacus Downes 81 posts 314 karma points
    Oct 20, 2016 @ 10:50
    Caractacus Downes
    0

    Hi,

    I finally got around to upgrading to Merchello 2.3.0 and the upgrade seems to have broken Merchelo somehow. I now have the helpful error message:

    The page cannot be displayed because an internal server error has occurred.

    I'm now going to go through the process of working out what's broken, but I'd appreciate some advice on how I should upgrade Merchello, as I don't think the upgrade process has ever worked smoothly for me, so I'm obviously doing something wrong. My site had M2.2.1 and FT2.2.1. I haven't upgraded FastTrack - do I need to? What I've done is a local package install using the M2.3.0 zip file.

    Cheers,

    Crac

  • Caractacus Downes 81 posts 314 karma points
    Oct 20, 2016 @ 11:30
    Caractacus Downes
    0

    OK, so a bit more digging ... it appears the MerchelloHelper object doesn't expose the TypedProductContent function any more.

    So my question now is how do I fix this and is theer a list of the other things I need to fix in my views before M2.3.0 will run?

    Cheers,

    Crac

  • Caractacus Downes 81 posts 314 karma points
    Oct 25, 2016 @ 08:44
    Caractacus Downes
    0

    I still haven't found a solution to this. Does anyone have any suggestions?

    Cheers,

    Crac

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 25, 2016 @ 16:25
    Rusty Swayne
    1

    Hey Caractacus,

    I missed adding the TypedProductContent change as a breaking change - It was moved to an extension method.

    Add using Merchello.Web - it's now in the MerchelloHelperExtensions.cs file.

  • Caractacus Downes 81 posts 314 karma points
    Oct 26, 2016 @ 08:44
    Caractacus Downes
    0

    Hi Rusty,

    That's great, that fixes that one.

    I now have another - this line of code in the Catalog view is raising an error:

    var categories = Model.Categories != null ? Model.Categories.Children().ToArray() : Enumerable.Empty<ProductCollection>();
    

    'IProductCollection' does not contain a definition for 'Children' ...

    Am I missing another reference, or do I need to update FastTrack to 2.3.0? If so how do I do that without losing all the customisation I've done on the templates?

    Cheers,

    Crac

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Oct 27, 2016 @ 15:26
    Rusty Swayne
    100

    That's in Merchello.Web as well. Just trying to cleanup the namespacing to make everything consistent.

  • Caractacus Downes 81 posts 314 karma points
    Oct 27, 2016 @ 16:11
    Caractacus Downes
    1

    OK, just in case anyone else has the same problem, after adding

    @using Merchello.Web
    

    to the top of the view I then also had to change ProductCollection to IProductCollection in a couple of places to get it to work ...

    I think you've renamed the IProductCollection.CollectionKey property to be just IProductCollection.Key now as well.

    Cheers,

    Crac

Please Sign in or register to post replies

Write your reply to:

Draft