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 06, 2016 @ 16:30
    Kevin
    0

    Multiple Text Box corrupts json in DetachedDataValues

    I have a content type in Umbraco that includes the new Mutliple Text Box field. This Umbraco Content Type is assigned as a Product Content type in Merchello. I also have 2 languages.

    When I edit a product in Merchello I clicked on the "Extended Data" ta to edit the data in the Multiple Text Box control. I can choose the language using the language selector in the top right.

    The Multiple Data Text box is correctly saved as JSON in the Detached Content Values but only for the currently selected language. If I change the language and add data and save, this multiple text box data saves correctly for the current language, but the data for the initial language becomes corrupted. The data is still there in the json but it is prefexid by a new JSON array.

    I have breakpoints in merchello.controllers.js and can see the corrupt data so believe this is an issue with the angular data binding but I am not sure where to look now to try to fix this. Any pointers appreciated.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 06, 2016 @ 16:49
    Rusty Swayne
    0

    Hi Kevin,

    Are you catching the value (in Angular) on the post or in the response?

    Can you post an example of the value you're seeing?

  • Kevin 35 posts 159 karma points
    Dec 06, 2016 @ 17:29
    Kevin
    0

    The control is actually "Repeatable textstrings".

    The 2 screenshots attached show a new product created in German with strings "Tom", "Dick" and "Harry". Immediately after saving, the language display is changed to US English and the value on display is [].

    After saving the US product making no changes, the German text strings value is saved as raw JSON.

    I shall take some more screenshots now of the debugger to show how the values change when editted.

    enter image description here

    enter image description here

    enter image description here

  • Kevin 35 posts 159 karma points
    Dec 06, 2016 @ 17:39
    Kevin
    0

    After a few saves of knife, fork and spoon in German, we can see in the watch window the German version (the currently displayed language) is correct, but the US version has grown very long.

    enter image description here

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 06, 2016 @ 18:49
    Rusty Swayne
    0

    Kevin,

    It may be that the controller is only treating the value from the current language as an editor value and the other values are getting serialized (again) as a JSON string - even though they had already been previously stored correctly.

    If that assessment is correct, the issue may be in the ProductVariantDetachedContentHelper or the DetachedValuesConverter (which is used by the ProductVariantDetachedContentHelper).

    https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Web/Models/ContentEditing/Content/ProductVariantDetachedContentHelper.cs#L30

    We should write up an issue in the issue tracker (http://issues.merchello.com) so we can track this one ... I'll try to replicate this issue as well.

  • Kevin 35 posts 159 karma points
    Dec 06, 2016 @ 18:56
    Kevin
    1

    Thanks Rusty,

    I will dig deeper. I have raised issue M-1251.

  • [email protected] 14 posts 114 karma points
    Jan 16, 2017 @ 15:10
    shay@ideomobile.com
    0

    Hi, also have this problem. Is there a fix version?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Jan 16, 2017 @ 17:23
    Rusty Swayne
    0

    This one is still an open issue - I've already spent a couple of hours trying to fix it, but it's proving not to be a quick fix. The issue stems from the serialization / deserialization or the string stored in the detached content values collection to JSON when multiple cultures are present.

    The MultiTextString editor is a sort of an oddity in the way it saves data delineated by carriage returns and there we had to do a correction to present it properly to the front end as well.

Please Sign in or register to post replies

Write your reply to:

Draft