Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1444 posts 1855 karma points
    Feb 06, 2017 @ 22:22
    Gordon Saxby
    0

    No route in the route table matches the supplied values

    I am (desperately) trying to integrate FastTrack with an existing site. I have got products showing, but when I click any "Add to Basket" button, I get the following error:

        No route in the route table matches the supplied values.
    
    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.InvalidOperationException: No route in the route table matches the supplied values.
    
    Source Error: 
    
    
    Line 43: 
    Line 44:     @Html.Partial("MainMenu")
    Line 45:     @Html.Action("DisplayCarousel", "BannerCarousel", new { imagesList = currentPage.GetPropertyValue("images") })
    Line 46: 
    Line 47:     <section id="body" class="container">
    

    That is code in the main site's template.

    Interestingly (?), the item does actually get added to the basket and the page will load again if I refresh.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Feb 07, 2017 @ 18:02
    Rusty Swayne
    0

    Hey Gordon - I assume the issue is actually in the rendering of @Html.Partial("MainMenu")

    If you've moved the store root so that it is not at XPATH //root/ you may see that error. Another way would be if you are not using. the content types (document types) from FastTrack so the document type name changes.

    These can be adjusted in the FastTrack.config file /App_Plugins/FastTrack/Config/fasttrack.config

    Note the line:

          <!-- Gets the xpath to the location of the "store" content type or whatever is configured -->
          <setting alias="StoreRootXpath" value="//root/" />
    

    was added in the recent Merchello 2.4.0 release.

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 07, 2017 @ 19:31
    Gordon Saxby
    0

    I have v2.4, I have put the "ftStore" node underneath the website home page, I have set "StoreRootXPath" to "//homePage/" which is the website root / home page.

    The site and shop seems to work OK so far (displays products) but has this error when I add items to the basket.

    Why would changing from "//root/" cause the problem?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Feb 08, 2017 @ 00:02
    Rusty Swayne
    0

    You might try //root/homePage/

    The only issue is probably when the "ExampleUiHelper" tries to find the content for redirection and is getting a null from the store root lookup.

    You could also write your own version of that - it is not required for Merchello - it's just the method I used to find the pages I used in the starter kit.

    https://github.com/rustyswayne/Merchello/blob/merchello-dev/src/Merchello.FastTrack.Ui/ExampleUiHelper.cs

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 08, 2017 @ 09:04
    Gordon Saxby
    0

    I tried //root/homePage/ but it still failed.

    I created my own version of "ExampleUiHelper" and checked that "GetStoreRoot()" was returning the right node ... and it was.

    The main store page loads the first time, but it fails after anything is added to the basket!? I commented out the error line and the page loads OK after adding items to the basket.

    So, does the add basket code do something with the default routing? It seems as though BannerCarouselController can't be found?

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 08, 2017 @ 09:37
    Gordon Saxby
    102

    OK - adding area = "" to the Action seems to have fixed it!?

    @Html.Action("DisplayCarousel", "BannerCarousel", new { imagesList = currentPage.GetPropertyValue("images"), area = "" })
    
  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Feb 08, 2017 @ 17:37
    Rusty Swayne
    0

    BannerCarouselController is not something from Merchello or FastTrack so I can't be sure what is happening with that.

    Neither Merchello or FastTrack do anything to routing outside of what I would at least consider standard Umbraco practice.

    The controllers are decorated with Umbraco's PluginControllerAttribute which essentially allows for putting views in the respective App_Plugins folders (but they work as well if moved to the views folder) ...

    Other than that the only thing that I would consider as a route alteration would be the ContentFinderProductBySlug which allows Umbraco to find the product content pages. However, that class is just an implementation of Umbraco's IContentFinder which is internally used by Umbraco for rendering IPublishedContent.

    There is no place in Merchello or FastTrack where any "direct" augmentations to the RouteTable are made.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 25, 2020 @ 14:07
    Alex Skrypnyk
    0

    Thanks, Gordon!!! You saved my day

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 08, 2017 @ 17:53
    Gordon Saxby
    0

    The page loads fine initially, it only has trouble after clicking "add to basket" - weird!

    Anyway, it doesn't appear to have caused any side-effects so I'l leave it as it is.

Please Sign in or register to post replies

Write your reply to:

Draft