API page: https://api.drupal.org/api/drupal/includes%21form.inc/function/form_proc...

The page says "#empty_option: (optional) The label to show for the first default option. By default, the label is automatically set to "- Please select -" for a required field..." but in fact the label shown is just '- Select -'.

I discovered this as I wanted to change the default label to a much more friendly 'Please select' in my own form.

Beta evaluation: Unfrozen - API docs changes only.

Comments

jhodgdon’s picture

Issue tags: +Novice

Thanks for the report! This should be an easy Novice project to fix the documentation.

sagar ramgade’s picture

StatusFileSize
new762 bytes

Patch attached :-)

zealfire’s picture

Status: Active » Needs review

@Sagar Ramgade,you should always set the status to "Needs review" whenever you submit a patch because then only it would be sent for testing and people can know that it need to be reviewed :)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

@zealfire means to set it to "Needs Review". :)

Anyway, the patch looks good, thanks!

David_Rothstein’s picture

Version: 7.x-dev » 8.0.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs backport to D7

Looks good, but we should fix this in Drupal 8 also; the same issue exists there - Drupal\Core\Render\Element\Select::processSelect()

drupalgideon’s picture

Status: Needs work » Needs review
StatusFileSize
new1013 bytes

Just so happened to be playing with D8 this weekend so I thought I'd create this patch as I reported the issue!

joshi.rohit100’s picture

I was about to upload the same patch :)

dom.’s picture

Status: Needs review » Reviewed & tested by the community

Hi !
Patch #6 tested (manually applied) and reviewed (manually read through).
I thought comments should not exceed 80 characters but it aligns with the rest at 82, so no issue here.
RTBC+1

dom.’s picture

Issue tags: -Needs backport to D7

Remove backport need to D7: created dedicated clone issue here for that : #2462835: Default empty option label text different in documentation.

David_Rothstein’s picture

Issue tags: +Needs backport to D7

Actually, we should leave the backport in this issue in order to be able to track the work better (see https://www.drupal.org/node/767608). I'll close the other as a duplicate.

David_Rothstein’s picture

By the way, I agree with RTBC for the Drupal 8 patch :)

dom.’s picture

@David_Rothstein : I did not know, now I know !
Thanks

jhodgdon’s picture

Issue summary: View changes

Thanks, looks good for 8, and I verified the defaults are as in the docs. Adding beta eval to summary.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: D8-processSelect-Empty-Label-Documentation-2428399-6.patch, failed testing.

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Should be back to RTBC unless the patch doesn't apply and the test bot complains. I assume that was a random test failure?

alexpott’s picture

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

Committed 443ef75 and pushed to 8.0.x. Thanks!

  • alexpott committed 443ef75 on 8.0.x
    Issue #2428399 by SkidNCrashwell, Sagar Ramgade: Default empty option...
pushpinderchauhan’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new762 bytes

D7 patch.

joshi.rohit100’s picture

StatusFileSize
new894 bytes
new813 bytes

I think #2 is same as #19. I have just made this same as #6 :)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good! I just double-checked and it is true as written in D7.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 20: D7-Empty_label_documentation-2428399-29.patch, failed testing.

damienmckenna’s picture

Assigned: Unassigned » damienmckenna

I'm going to work on this as part of Drupal Ladder training for NHDevDays :)

damienmckenna’s picture

Status: Needs work » Reviewed & tested by the community

The test that fails has no bearing on this patch - the patch only affects a comment, the test that fails is checking something on the tableselect output. Putting this patch back RTBC.

damienmckenna’s picture

Assigned: damienmckenna » Unassigned
David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks!

  • David_Rothstein committed 1a17a80 on 7.x
    Issue #2428399 by joshi.rohit100, SkidNCrashwell, Sagar Ramgade, er....

Status: Fixed » Closed (fixed)

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