HtmlRenderer: submit type for create and edit action buttons#41
Open
titus-toia wants to merge 1 commit into
Open
HtmlRenderer: submit type for create and edit action buttons#41titus-toia wants to merge 1 commit into
titus-toia wants to merge 1 commit into
Conversation
The action buttons rendered by HtmlRenderer only set type=submit for 'save'; 'create' and 'edit' fell through to type=button, so their forms never posted (e.g. the DataView 'Add New' create form was a dead button). route_plural already handles their POST submissions. Delete is left as a button since this renderer adds no confirm handler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
HtmlRenderer::render_action()setstype="submit"only for thesaveaction;createandeditfall through totype="button". Atype=buttonbutton submits nothing, so any form rendered byHtmlRendererwhose action iscreate/editis a dead button — clicking it does nothing (no POST, no navigation, no network request).Concretely: the DataView "Add New" create form can't create anything — Create is a dead button. (The
TangibleFieldsRendereralready maps create/save to submit; onlyHtmlRendererwas missing it.)Fix
route_plural()already handles thecreate/editPOST submissions, so this just lets the buttons actually post. Purely additive:saveunchanged, custom JS actions staybutton.deleteis intentionally left asbutton— this renderer adds no confirmonclick, so making it a bare submit would be a no-confirm delete. Deletion is handled via list-view links.