Posted by sun on December 14, 2012 at 7:21pm
4 followers
Jump to:
| 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
#inputfacility of#type 'item'for$form['author']['name']in the comment form.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal8.comment-item.0.patch | 2.4 KB | Idle | PASSED: [[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
The last submitted patch, drupal8.comment-item.0.patch, failed testing.
#6
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
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
Committed to 8.x. Thanks.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.