The options for the 'confirm form' flag link type are technically required, in that leaving them blank and submitting the form makes the form fail submission.

However, they are not marked as #required in the form array, so the user doesn't know they were required until they see the error message.

The reason for this is that they are hidden, and only shown if you pick the link type they go with. So making them #required would mean that they'd be required even when hidden and irrelevant -- which would be a huge UI bug!

But now on D7 we can achieve this with states: we already toggle visibility based on the link type checkbox; we can do the same with the 'required' property.

Files: 
CommentFileSizeAuthor
#1 2053469.flag_.link-type-options-required.patch2.99 KBjoachim
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new2.99 KB
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es).
[ View ]

+++ b/includes/flag.admin.inc
@@ -536,6 +538,8 @@ function flag_form($form, &$form_state, $flag) {
+    // This will get change to a state by flag_link_type_options_states().

Shouldn't that be "changed"? Otherwise, looks good. Confirmed by manual testing.

Status:Needs review» Needs work

Forgot to tag.

Status:Needs work» Fixed

Thanks!

Committed with that docs fix in 2 places & another docs tweak.

Status:Fixed» Closed (fixed)

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