Copied to clipboard

Flag this post as spam?

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


  • Kevin 35 posts 159 karma points
    Dec 05, 2016 @ 15:09
    Kevin
    0

    Incorrect error logging

    In Umbraco I have created my own content type that includes an optional Merchello Product Picker field.

    I read the value in code like this:

    myProductContent.GetValue<Guid>("myFieldName");
    

    When a product is chosen, everything works as it should and I read the guid of the selected product.

    However, as it's an optional field, the value can be left blank.

    When it is left blank, the GetValue code above ends up executing this Merchello code:

    Merchello.Web.PropertyConverters.ProductDisplayValueConverter.ConvertDataToSource
    
    try
    {
      var key = new Guid(productKey);
      return merchello.Query.Product.GetByKey(key);
    }
    catch (Exception ex)
    {
      MultiLogHelper.Error

    As there is no chosen value, the catch block is entered and an error log created. However, this is not an error. No value has been chosen. Is this a bug?

Please Sign in or register to post replies

Write your reply to:

Draft