Problem/Motivation

Given workflow buttons are configured to be shown on a view display,
And a user submits the node form from a view display,
When a user has validation errors on submit,
Then the user should be redirected to a form display,
So that they can address the field validation errors.

Steps to reproduce

TBD

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

API changes

Data model changes

Comments

jcandan created an issue. See original summary.

jcandan’s picture

Issue summary: View changes

Thinking more about the original issue description, maybe it is obvious to which form display a user might be routed--we just route to the canonical form display route. Which form display is used is handled by just landing on the edit route.

I attempted a patch where we did just that, and simply forwarded the error messages on during the redirect. However, for my use-case, this doesn't quite address our niche issue: we change the error messages.

As it stands, in a hook_form_alter() $form['#validate'] callback, the $form_state->getErrors() are very different when submitting from the view display rather than the form display. So, our niche error manipulation logic needs to change--

Or, rather than capture and pass on the validation error messages, the validation needs to be run again once redirected to the form display.

Not sure yet if this is a good general case or feature. Digging.

jcandan’s picture

Status: Active » Closed (won't fix)

Not a recommended path. We ended up abandoning having the buttons on the view display.

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.