Copied to clipboard

Flag this post as spam?

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


  • Edgar Rasquin 326 posts 925 karma points
    May 05, 2021 @ 15:59
    Edgar Rasquin
    0

    GetInUseProductAttributes obsolete after Vendr upgrade from 1.5.0 to 1.8.0

    Hi,

    after upgrading to 1.8.0 I get an error in my Product.schtml

    @helper RenderVariants(StoreReadOnly store, Product product, string addedProductReference)
    

    where attrs are declared:

    var attrs = multiVariantProductPage.Variants.GetInUseProductAttributes(store.Id);
    

    YSOD says:

    CS0121: The call is ambiguous between the following methods or properties: 'Vendr.Core.ProductVariantCollectionExtensions.GetInUseProductAttributes(Vendr.Core.Models.ProductVariantCollection, System.Guid)' and 'Vendr.Core.Models.ProductVariantCollectionExtensions.GetInUseProductAttributes(Vendr.Core.Models.ProductVariantCollection, System.Guid)'
    

    How can I fix this?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    May 06, 2021 @ 09:16
    Matt Brailsford
    100

    Hi Edgar,

    We're going to resolve this properly in an upcoming patch release but the problem is some of our extension methods are in the wrong place so we moved them and obsoleted the old ones, but not this is causing this conflict.

    You can get around it for now by adding a using statement at the top of your view file

    @using ProductVariantCollectionExtensions = Vendr.Core.ProductVariantCollectionExtensions;
    

    And then where you call GetInUseProductAttributes change it to

    var attrs = ProductVariantCollectionExtensions.GetInUseProductAttributes(multiVariantProductPage.Variants);
    

    Matt

  • Edgar Rasquin 326 posts 925 karma points
    May 06, 2021 @ 09:26
    Edgar Rasquin
    0

    Thanks Matt,

    that solved the problem.

    Edgar

Please Sign in or register to post replies

Write your reply to:

Draft