Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax api doesn't include width of columns when retrieving a form #981

Closed
jaandrews opened this issue Feb 18, 2023 · 1 comment
Closed

Ajax api doesn't include width of columns when retrieving a form #981

jaandrews opened this issue Feb 18, 2023 · 1 comment

Comments

@jaandrews
Copy link

Umbraco Version: 10.4.0
Umbraco Forms Version: 10.2.3

When I call the api to get form data via an api call, all of the column widths are 0 (api call to "/umbraco/forms/api/v1.0/definitions/{id}?contentId={contentId}"). This issue can even be seen in the example response data in the documentation, which has 0 instead of 12 for the column width.

Reproduction

Bug summary

Width property of columns in form data is always 0.

Specifics

It looks like it's just a data point that was left out when structuring the data returned by the api in the FormDtoFactory class. The code below doesn't set the width property.

private FormFieldsetColumnDto BuildFormColumnDto(Form form, Hashtable? pageElements, FieldsetContainer container) {
    Form form2 = form;
    Hashtable pageElements2 = pageElements;
    return new FormFieldsetColumnDto {
        Caption = _placeholderParsingService.ParsePlaceHolders(container.Caption ?? string.Empty, null, form2, pageElements2),
        Fields = from x in container.Fields
                 select BuildFormFieldDto(form2, pageElements2, x) into x
                 where x != null
                 select (x)
    };
}

Steps to reproduce

  1. Create a form
  2. Add a property to a group.
  3. Save the form.
  4. Check the results of the api call to see whether the width is set.

Expected result

I expect the value of width to be 12 for a one column layout, 6 for a two column layout, etc.

Actual result

All column widths are set to 0.

@AndyButland
Copy link

Thanks @jaandrews - looks like you've identified the oversight here. We'll get this fixed for the next releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants