Copied to clipboard

Flag this post as spam?

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


  • Peter S 64 posts 106 karma points
    Dec 19, 2017 @ 13:30
    Peter S
    0

    Slug results in 404 after DB import

    Hi,

    Since we had to import over 4000 product with variants, we had to opt for a Database direct import into Merchello. The data imports fine into all the needed tables, but for some reason the slugs all give a 404 error after an import. When I press 'save' on an imported product in the Merchello section in Umbraco, the slug works.

    What extra steps need to be taken after an import to make this work without having to press the save button?

    Using Merchello 2.5.0.

  • Puck Holshuijsen 184 posts 727 karma points
    Dec 19, 2017 @ 13:45
    Puck Holshuijsen
    0

    I had some similar issues. What worked for me, was to edit the web.config and save the file.

    Hope it also works for you.

  • Peter S 64 posts 106 karma points
    Dec 19, 2017 @ 14:09
    Peter S
    0

    I also thought it would have something to do with caching, touching the web.config didn't help in my case. Nor did restarting the application.

    I've also tried :

    _contentService.RebuildXmlStructures();
    _contentService.RePublishAll();
    
    ExamineManager.Instance.IndexProviderCollection["MerchelloProductIndexer"].RebuildIndex();
    ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearAllCache();
    

    But none of these are helping. There must be something else I'm missing.

  • Puck Holshuijsen 184 posts 727 karma points
    Dec 19, 2017 @ 14:15
    Puck Holshuijsen
    0

    What if you get all the products, and go through each of them and save them..

    var productService = Merchello.Core.MerchelloContext.Current.Services.ProductService;
        var allProducts =productService.GetAll();
    
        allProducts.ForEach(x => productService.Save(x));
    

    Haven't tested this, but something like that?

    And run the index after that

  • Peter S 64 posts 106 karma points
    Dec 19, 2017 @ 14:53
    Peter S
    0

    Good suggestion. But unfortunately this does not work for me. Tried, saving all products, republishing all and rebuilding the product index. But still a 404 till I hit that save button in Umbraco.

    I'll dive deeper into the Merchello source code to see what extra steps that save button does.

  • Puck Holshuijsen 184 posts 727 karma points
    Dec 19, 2017 @ 14:55
    Puck Holshuijsen
    0

    Too bad! Hop you'll figure it out!

  • Peter S 64 posts 106 karma points
    Dec 19, 2017 @ 15:02
    Peter S
    0

    Thanks for the suggestions anyway :)

  • Peter S 64 posts 106 karma points
    Dec 20, 2017 @ 08:10
    Peter S
    0

    Finally got it working. Turned out the 'TemplateId' column in the 'merchProductVariantDetachedContent' table was empty. After filling that with the correct template id , everything works fine.

Please Sign in or register to post replies

Write your reply to:

Draft