Problem/Motivation

Removing value of required sdc component property causes fatal error.

Steps to reproduce

- Add "x-canvas-group: content" (or style, etc.) to a required component property (e.g. inside "byte_theme", "heading.component.yml", "heading_text").
- Go to the component settings on the UI and empty the property value of this required property ("Heading Text"):
screenshot1
- Resulting in an error on the settings page, making the entire component unusable, since the input for readding the required input is gone entirely:
screenshot2

Proposed resolution

Without the "x-canvas-group" key, it works as expected, so we should identify the problem and fix it.

Workaround

For properties in x-canvas-group: content simply remove this line, as content is the default anyway. This workarounds the issue.
For properties in style, etc. this doesn't work of course.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

grevil created an issue. See original summary.

anybody’s picture

Priority: Normal » Major
Issue summary: View changes

I can confirm this issue and I think we should see it as major for canvas_builder.

Without x-canvas-group: X the component form works as expected and shows the expected validation error, if a required field is empty.

anybody’s picture

Issue tags: +Needs tests
aaronchristian’s picture

Thanks for reporting @grevil

I'll have a fix in shortly to the development branch with a test.

I'll post here when its ready for testing.

aaronchristian’s picture

Assigned: Unassigned » aaronchristian

  • aaronchristian committed b0940a39 on 1.0.x
    fix: strip x-canvas-group at discovery to prevent fatal on required...
aaronchristian’s picture

This is on the dev branch now.

aaronchristian’s picture

Status: Active » Needs review
grevil’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Thanks! This does the trick!

grevil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.