Skip to content

Multiple Textstrings not saving, when used for settings on providers #734

@skttl

Description

@skttl

Which component is this issue related to?

Umbraco Commerce (Core)

Which Umbraco Commerce version are you using? (Please write the exact version, example: 10.1.0)

16.0.0

Bug summary

I have a 16.0.0 with a custom discount reward provider looking like this

[DiscountRewardProvider("myMultipleTextstringProvider", Label = "Multiple Text")]
public class MultipleTextDiscountRewardProvider
    : DiscountRewardProviderBase<MultipleTextDiscountRewardProviderSettings>
{
    public MultipleTextDiscountRewardProvider(UmbracoCommerceContext ctx)
        : base(ctx) { }
}

public class MultipleTextDiscountRewardProviderSettings
{
    [DiscountRewardProviderSetting(
        Label = "Strings",
        SortOrder = 1,
        Key = "strings",
        EditorAlias = "Umbraco.MultipleTextstring",
        EditorConfig = "{\"min\":0,\"max\":0}"
    )]
    public IEnumerable<string> Strings { get; set; } = Enumerable.Empty<string>();
}

When adding the reward, I get the setting with the multiple textstring editor as expected:

Image

When saving, the payload looks correct:

Image

But the response is missing the values:

Image

I also tried adding the most basic setting I could come up with:

    [DiscountRewardProviderSetting(Label = "String", Key = "string")]
    public string String { get; set; } = "";

This works as expected when saving.

Image Image

Specifics

No response

Steps to reproduce

  • Create a reward/rule provider, with a setting using Multiple textstrings as mentioned above.
  • Try to add a discount using the provider, add some text in the multiple text strings

Expected result / actual result

Expected to save the text put in the multiple textstrings, but didn't.

Dependencies

No response


This item has been added to our backlog AB#54663

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions