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

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

Closed
emteknetnz opened this issue Apr 18, 2024 · 4 comments
Closed

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Apr 18, 2024

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

  • Have an elemental block with a "has on" to link and matching link field
  • Create the block.
  • Edit the block and save without creating a link

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

Wasn't tested with has many.

Acceptance criteria

  • Fix the bug
  • Add a behat test to make sure elemental doesn't crash if you don't save a link in your linkfield.

PRs

@GuySartorelli
Copy link
Member

@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
Copy link
Member Author

emteknetnz commented May 5, 2024

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
Copy link
Member

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
Copy link
Member Author

Will close

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