Download & Extend

Leverage new #input facility of #type 'item' for author name in comment form

Project:Drupal core
Version:8.x-dev
Component:comment.module
Category:task
Priority:normal
Assigned:sun
Status:closed (fixed)
Issue tags:API clean-up

Issue Summary

Follow-up to: #1825044: Turn contact form submissions into full-blown Contact Message entities, without storage

Problem

  • The comment form uses two different form elements and array keys for the author name, depending on whether the current user is anonymous or authenticated.

Goal

  • Leverage the new #input facility of #type 'item' for $form['author']['name'] in the comment form.
AttachmentSizeStatusTest resultOperations
drupal8.comment-item.0.patch2.4 KBIdlePASSED: [[SimpleTest]]: [MySQL] 49,347 pass(es).View details

Comments

#1

Excellent. I wanted to do this for D7 already in #644648: comment_form() structure is inconsistent / $form['#token'] WTF, but back then, I didn't have the idea of simply allowing #type 'item' to accept #input. :)

#2

drupal8.comment-item.0.patch queued for re-testing.

#3

drupal8.comment-item.0.patch queued for re-testing.

#4

drupal8.comment-item.0.patch queued for re-testing.

#5

Status:needs review» needs work

The last submitted patch, drupal8.comment-item.0.patch, failed testing.

#6

Status:needs work» needs review

drupal8.comment-item.0.patch queued for re-testing.

#7

drupal8.comment-item.0.patch queued for re-testing.

#8

drupal8.comment-item.0.patch queued for re-testing.

#9

Status:needs review» reviewed & tested by the community

Friends, this patch is both too simple and at the same time too effective to be ignored for more than a month. This trivial change allows me to clean up and remove some ugly special-casing from at least one contributed module.

I already mentioned this issue/patch in a couple of other issues, but no one followed this issue thus far. So please excuse me for going out of line, but this truly is a no-brainer, a pure simplification and refactoring, to remove a WTF and simplify the code by leveraging D8's latest and greatest APIs.

#10

This is a neat trick. (The patch makes much more sense with git diff -w)

Count this as an RTBC, since the patch author can't RTBC.

#11

Status:reviewed & tested by the community» fixed

Committed to 8.x. Thanks.

#12

Status:fixed» closed (fixed)

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