Problem:

According to Drupal interface patters http://drupal.org/node/387526 it's recommended to use checkbox control instead dropdown for on / off values.
Currently category edit screen violates this, providing "Yes / No" dropdown for "Selected "value.

Solution:

Replace dropdown control with a singe checkbox with following label:

[ x ] Make this the default category.

Comments

yoroy’s picture

mockup

Yes :)

kika’s picture

Here's the patch.

Not sure about punctuation, it seems from http://drupal.org/node/387526 that the rule is to have a . after single checkbox label.

kika’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal-category-default-1477704-2.patch, failed testing.

yoroy’s picture

The screenshot with a selected checkbox and that description looks quite self-referential :) Initially it didn't seem to mean that much. Maaaaybe a bit more specific:

[x] Make this the default category.

That two-line description for Weight looks bad doesn't it? #1477802: Shorter description for contact category weight

kika’s picture

Testbot fails, it's not so easy replace dropdowns with checkboxes. Any form guru can help out here?

@yoroy: Agreed, you got better wording in #5.

kid_icarus’s picture

Title: Replace "Seleced" dropdown with checkbox in category edit form » Replace "Selected" dropdown with checkbox in category edit form
Status: Needs work » Needs review
StatusFileSize
new1.92 KB

Modified the title as suggested in #5.

Modified contact.test to assign TRUE or FALSE to $edit['selected'], instead of '0' or '1', as suggested by DrupalWebTestCase::drupalPost $edit parameter:
"A checkbox can be set to TRUE to be checked and FALSE to be unchecked."

Also changed the issue title, as "Selected" was spelled "Seleced".

barraponto’s picture

I'm worried that contact_category_edit_form_submit() might unset defaults with integer zero first, then write records with boolean zero (if FAPI doesn't change it back to 0 and 1).

Bojhan’s picture

Issue tags: -Needs usability review
andypost’s picture

Issue tags: +documentation bug
StatusFileSize
new2.91 KB

Actually only unset value should be converted to FALSE according to WebTestBase::handleForm()
So I changed comment for drupalPost()

case 'checkbox':
          // To prevent checkbox from being checked.pass in a FALSE,
          // otherwise the checkbox will be set to its value regardless
          // of $edit.
          if ($edit[$name] === FALSE) {
            unset($edit[$name]);
            continue 2;
          }
          else {
            unset($edit[$name]);
            $post[$name] = $value;
          }
          break;

Test and documentation should backported

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks. Committed/pushed to 8.x.

tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev
Status: Patch (to be ported) » Fixed

This breaks string freeze and changes the UI, I don't think this is backportable.

andypost’s picture

Version: 8.x-dev » 7.x-dev
Category: bug » feature
Status: Fixed » Patch (to be ported)

let's get commiter's review probably this could be backported

catch’s picture

I only moved it for backport because of:

Test and documentation should backported

Don't know about the change itself (although that's also not up to me :).

andypost’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.86 KB

I mean this

Status: Needs review » Needs work

The last submitted patch, 1477704-checkbox-17.patch, failed testing.

farrington’s picture

Status: Needs review » Needs work
StatusFileSize
new1.88 KB

You can't change the test without the changes to contact.admin.inc. I'll make a try...

farrington’s picture

Status: Needs work » Needs review
StatusFileSize
new1.88 KB

Sorry, forgot the Status. *blush*

Edit: And didn't know that I don't have to re-attach the patch again.

Well, let's hope for the best... after all, it's my birthday today. :-)

tim.plunkett’s picture

So now this is just the patch in #10, but without the test docs changes. But still with the string changes.

And, it changes the form structure, possibly breaking any custom form_alters. See http://drupal.org/node/1527558 for an explanation of why this isn't backportable. And http://groups.drupal.org/node/210973#comment-701613 lists this as the second most intrusive type of Form API change, after removing an element completely.

farrington’s picture

StatusFileSize
new2.81 KB

Regarding http://groups.drupal.org/node/210973#comment-701613.

Well written, but if you read the last part of that comment... my conclusion is that this issue to be considered as back-portable?

So, here is a patch with the missing changes to the documentation of simpletest. And yes, it's a copy of #10... but this works for Drupal7. :-)

tim.plunkett’s picture

Status: Needs work » Needs review
Issue tags: +Needs backport to D7

Fixing tag.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Let's get commiters feedback, Summary updated

webchick’s picture

Hm. I also don't know that this is back-portable patch, but it's worth running past David. However, David has requested help on resolving release blockers, so I don't feel comfortable committing feature patches until that happens.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review

Sorry for not providing feedback here sooner, but I didn't have much time to work on Drupal the last few weeks, and I was focusing most of the time I did have on the release blockers (which I was only getting help from a couple other people on) and other bugs.

I would lean against committing this to Drupal 7 also. The policy linked to above makes clear that changing #type is a relatively intrusive change, and that we generally only consider these for critical issues.... In practice I think it's often more like "issues which have a big impact on user experience" rather than actual critical issues. But either way, does this issue qualify for that? Following user interface guidelines is of course important, but absent any direct evidence that the current behavior is causing usability issues for people trying to use this particular form, I think we should probably leave it alone.

Moving back to "needs review" to further discuss if that's the case, and if particular parts of the patch (e.g., documentation) should be backported instead.

sun’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Fixed

I agree with that - a #type change can have bad consequences on existing sites.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.