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.
CommentFileSizeAuthor
drupal8.comment-item.0.patch2.4 KBsun

Comments

sun’s picture

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. :)

sun’s picture

Issue tags: -API clean-up

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

sun’s picture

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

sun’s picture

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

Status: Needs review » Needs work

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

sun’s picture

Status: Needs work » Needs review

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

sun’s picture

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

sun’s picture

Issue tags: +API clean-up

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

sun’s picture

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.

tim.plunkett’s picture

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.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

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