silverstripe / silverstripe-linkfield

Silverstripe module for managing links
BSD 3-Clause "New" or "Revised" License
4 stars 14 forks source link

Child LinkField without a link will show an error after inline save #276

Closed emteknetnz closed 5 months ago

emteknetnz commented 5 months ago

After inline saving an element, a child LinkField without any links will make an XHR request that will 404 and front end will show "Failed to load link(s)"

Replication steps

Results: XHR request that will 404 and front end will show "Failed to load link(s)"

Wasn't tested with has many.

Acceptance criteria

PRs

GuySartorelli commented 5 months ago

@emteknetnz Please also add a behat test - the jest test is good for testing the specific value is handled, but it doesn't validate that the scenario described actually works. If something changes about how elemental handles forms or fields or values or form submission or any other number of things, this could break in another way.

emteknetnz commented 5 months ago

Both linkfield and elemental are optional modules with no dependency between them, I'm not sure how you'd even create a behat test here. It would probably need to be on kitchen-sink which seems pretty wrong. I think it's fine not having a behat test here.

GuySartorelli commented 5 months ago

Linkfield has elemental as a dev dependency, and already has a feature for behat tests with elemental. So it would fit in nicely there.

If with that context you still think it's not worth doing then feel free to close the issue.

emteknetnz commented 5 months ago

Will close