As discussed in #2010930: [META] Apply formatters and widgets to rendered entity base fields (all besides node.title) it is policy to make rendered base fields throughout core configurable through the "Manage form display" UI.

In the case of the comments module, this will take care of many frequently-asked feature requests. This issue is about the Comment entity type's uid, name, mail, homepage and created fields.

#2578741: Add setting for size to email widget was spun off half way through as a dependency of this issue and is already committed.

Making the same change for "Manage display" is being handled in a separate issue #3090187: Mechanism to disable preprocessing of base fields in comment entity type so they can be configured via the field UI.

Remaining tasks

  1. Rework patch to use, and remove any overlap with, #2578741: Add setting for size to email widget
  2. Fix test failures.
  3. Respond to code reviews #105,#106#108
  4. Create upgrade path & upgrade path tests
  5. ?"Once test failures are fixed, look into converting more base fields." (may no longer be relevant?)

User interface changes

None.

API changes

None. The comment.subject, comment.mail and comment.homepage base fields are rendered using widgets and formatters, and is no longer exposed as an "extra field".

CommentFileSizeAuthor
#160 2227503-160.patch30.21 KB_utsavsharma
#160 interdiff_158-160.txt717 bytes_utsavsharma
#159 interdiff_158_159.txt800 bytesameymudras
#159 2227503-159.patch30.22 KBameymudras
#158 interdiff_156_158.txt3.12 KBameymudras
#158 2227503-158.patch30.22 KBameymudras
#156 reroll_diff_149-156.txt25.9 KBsahil.goyal
#156 2227503-156.patch29.94 KBsahil.goyal
#149 interdiff_148-149.txt544 bytesvsujeetkumar
#149 2227503-149.patch20.31 KBvsujeetkumar
#148 2227503-148.patch20.65 KBvsujeetkumar
#142 2227503-comment-formatters-142.patch20.74 KBsokru
#135 comment-formatters-2227503-135.patch20.79 KBanas_maw
#130 comment-formatters-2227503-130.patch20.79 KByogeshmpawar
#122 comment-formatters-2227503-122.patch21.4 KBmohit_aghera
#117 comment-formatters-2227503-117.patch21.41 KBvprocessor
#103 comment-formatters-2227503.103.patch24.36 KBlarowlan
#100 2227503-comment-base-100.patch29.36 KBsegi
#95 2227503-comment-base-95.patch29.39 KBrteijeiro
#92 2227503-comment-base-92.patch29.87 KBsiva_epari
#88 2227503-comment-base-87.patch33.99 KBandypost
#88 interdiff.txt4.67 KBandypost
#85 2227503-comment-base-85.patch34.59 KBandypost
#85 interdiff.txt4.63 KBandypost
#83 2227503-comment-base-83.patch33.19 KBandypost
#83 interdiff.txt1.9 KBandypost
#80 2227503-comment-base-80.patch32.26 KBandypost
#74 comment-widgets-etc-2227503.74.patch36.98 KBlarowlan
#74 interdiff.txt5.81 KBlarowlan
#74 Screenshot 2015-01-13 15.28.52.png56.24 KBlarowlan
#71 comment-widgets-etc-2227503.70.patch35.11 KBlarowlan
#69 comment-widgets-etc-2227503.69.patch75.67 KBlarowlan
#65 comment-widgets-etc-2227503.64.patch33.23 KBlarowlan
#64 interdiff.txt477 byteslarowlan
#59 2227503-comment-base-59.patch33.02 KBpenyaskito
#57 2227503-comment-base-57.patch33.03 KBandypost
#57 interdiff.txt2.05 KBandypost
#55 2227503-comment-base-55.patch32.38 KBandypost
#55 interdiff.txt1.08 KBandypost
#55 comment-base-fields.png35.29 KBandypost
#51 comment-widget-formatters-2227503.51.patch32.38 KBlarowlan
#47 2227503-47.patch32.37 KBberdir
#43 interdiff-43.txt907 byteslokapujya
#43 2227503-43.patch34.38 KBlokapujya
#40 2227503-comment-base-40-interdiff.txt14.79 KBberdir
#40 2227503-comment-base-40.patch35.33 KBberdir
#38 2227503-comment-base-38-interdiff.txt15.87 KBberdir
#38 2227503-comment-base-38.patch22.19 KBberdir
#36 2227503-comment-base-36.patch14.7 KBandypost
#36 interdiff.txt1.33 KBandypost
#34 2227503-comment-base-34.patch14.64 KBandypost
#34 interdiff.txt2.16 KBandypost
#32 2227503-comment-base-100.patch13.53 KBandypost
#32 interdiff.txt4.89 KBandypost
#30 2226493-comment-base-99.patch9.11 KBandypost
#27 2292821-comment-swf-15.patch30.39 KBandypost
#22 interdiff.txt1.42 KBlokapujya
#22 2227503-22.patch30.35 KBlokapujya
#20 2227503-20.patch29.57 KBlokapujya
#14 comment_base_fields_formatters_widgets-2227503-14.patch29.63 KBsegi
#10 interdiff.txt6.07 KBwim leers
#10 comment_base_fields_formatters_widgets-2227503-10.patch30.8 KBwim leers
#8 comment_base_fields_formatters_widgets-2227503-7-interdiff.txt4.87 KBberdir
#8 comment_base_fields_formatters_widgets-2227503-7.patch24.43 KBberdir
#5 comment_base_fields_formatters_widgets-2227503-5-interdiff.txt19.27 KBberdir
#5 comment_base_fields_formatters_widgets-2227503-5.patch21.73 KBberdir
#1 comment_base_fields_formatters_widgets-2227503-1.patch2.67 KBwim leers

Comments

wim leers’s picture

wim leers’s picture

+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -209,13 +212,10 @@ public function form(array $form, array &$form_state) {
+    unset($form['subject']['widget'][0]['value']['#description']);

This should actually be done in the widget; so we'll actually need to override the string: either in a comment module-specific way, or as a DescriptionLessStringWidget… which feels ugly.

(Because otherwise there won't be a description in the comment form, but there will be when in-place editing.)

Status: Needs review » Needs work

The last submitted patch, 1: comment_base_fields_formatters_widgets-2227503-1.patch, failed testing.

e0ipso’s picture

Assigned: Unassigned » e0ipso
berdir’s picture

Fixing those test fails.

Status: Needs review » Needs work

The last submitted patch, 5: comment_base_fields_formatters_widgets-2227503-5.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review

Fixing the remaining test fails.

The access stuff should be handled through field access, but we're waiting on #2029855: Missing access control for user base fields for that to become easier.

berdir’s picture

wim leers’s picture

Issue summary: View changes

Also did the mail, homepage and created fields now. Still not everything, but at least we're still moving forward.

I didn't fix the tests yet.

wim leers’s picture

… and now with an actual patch.

Fixing the tests is a great issue for a novice to work on, e.g. at NYC camp.

Status: Needs review » Needs work

The last submitted patch, 10: comment_base_fields_formatters_widgets-2227503-10.patch, failed testing.

berdir’s picture

  1. +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
    @@ -259,21 +259,35 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    +      ->setSetting('max_length', 64)
    

    Should we really care about 60 vs 64 characters? Keeping the current UI is important, but 4 characters more or less really doesn't make much of a difference?

  2. +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
    @@ -259,21 +259,35 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     
    +    // @todo: use timestamp widget after https://drupal.org/node/2226493 lands.
         $fields['created'] = FieldDefinition::create('created')
    

    Yeah, I was wondering if we should try to get the new widgets/formatters in separately because node is quite a tough issue. But then we wouldn't have test coverage for them...

segi’s picture

Need to reroll.

segi’s picture

segi’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 14: comment_base_fields_formatters_widgets-2227503-14.patch, failed testing.

gcb’s picture

Assigned: e0ipso » Unassigned

@e0ipso looks like it's been a while, so unassigned, just comment if you want it back!

I'm at NYC Camp sprint right now, so going to have a look and see what I can do with it.

segi’s picture

One test fails, because the comment form not posted after submit. I got this error message after submit
"This value should be of the correct primitive type."
I found out that, this row cause the problem:

<?php
$form['author']['homepage']['widget'][0]['value']['#access'] = $is_admin || ($this->currentUser->isAnonymous() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT);
?>

This field get FALSE value, but I don't have enough experience so I don't have idea what cause the problem.

yched’s picture

Issue summary: View changes
lokapujya’s picture

Status: Needs work » Needs review
Issue tags: -sprint
StatusFileSize
new29.57 KB

This will fail. It's just the re-roll for now. Applied #8, then manually applied interdiff from #10, and fixed a merge conflict.

Status: Needs review » Needs work

The last submitted patch, 20: 2227503-20.patch, failed testing.

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new30.35 KB
new1.42 KB

Fixed at least one test here.

Status: Needs review » Needs work

The last submitted patch, 22: 2227503-22.patch, failed testing.

lokapujya’s picture

This needs more than just fixing the tests. When I manually go to :
/comment/reply/node/1/comment

1. I get an AJAX error.
2. When I submit the comment, I get: "This value should be of the correct primitive type."

#2 was introduced by the interdiff in #10.

lokapujya’s picture

Issue tags: -Novice
andypost’s picture

I'm doing conversion of comment subject field in #2292821: Use widget for comment subject field
But my one changes a migration path so probably better to fix subject field here and proceed with migration in the related

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new30.39 KB

Here's a patch for comment subject field only

andypost’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
wim leers’s picture

Nice work, now this patch will become quite a bit simpler!

Any chance you could reroll this patch also? I can provide reviews. (You're already familiar with the latest code base, so it would be easier for you to reroll this than for someone else.)

andypost’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new9.11 KB

Wrongly filed patches to #2226493-95: Apply formatters and widgets to Node base fields

Initial patch, also converts name field

PS: pushed to github

Status: Needs review » Needs work

The last submitted patch, 30: 2226493-comment-base-99.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new4.89 KB
new13.53 KB

should fix reply form

Status: Needs review » Needs work

The last submitted patch, 32: 2227503-comment-base-100.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new2.16 KB
new14.64 KB

homepage validation broken somehow (empty homepage does not pass validation via "uri" widget)

Status: Needs review » Needs work

The last submitted patch, 34: 2227503-comment-base-34.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB
new14.7 KB

another try

Status: Needs review » Needs work

The last submitted patch, 36: 2227503-comment-base-36.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new22.19 KB
new15.87 KB

This won't pass yet, but this is cleaning up a lot of stuff. Also adding access control. uid/name certainly needs more work, we'll see about other things.

Status: Needs review » Needs work

The last submitted patch, 38: 2227503-comment-base-38.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new35.33 KB
new14.79 KB

Fixing some tests.

Most remaining fails are related to uid/name behavior. Not sure yet how to make sense of that.

Status: Needs review » Needs work

The last submitted patch, 40: 2227503-comment-base-40.patch, failed testing.

lokapujya’s picture

+++ b/core/modules/rdf/src/Tests/CommentAttributesTest.php
@@ -155,9 +155,9 @@ public function testCommentRdfaMarkup() {
     // Posts comment #2 as anonymous user.
     $anonymous_user = array();
-    $anonymous_user['name'] = $this->randomMachineName();
-    $anonymous_user['mail'] = 'tester@simpletest.org';
-    $anonymous_user['homepage'] = 'http://example.org/';
+    $anonymous_user['name[0][value]'] = $this->randomMachineName();
+    $anonymous_user['mail[0][value]'] = 'tester@simpletest.org';
+    $anonymous_user['homepage[0][value]'] = 'http://example.org/';
     $comment2 = $this->saveComment($this->node->id(), 0, $anonymous_user);

Do we need this? It gets passed to entity_create().

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new34.38 KB
new907 bytes

Will try it.

Status: Needs review » Needs work

The last submitted patch, 43: 2227503-43.patch, failed testing.

lokapujya’s picture

Issue tags: +Needs reroll

I was surprised to see more errors. I think it needs to be re-rolled due to: #2287071: Add cacheability metadata to access checks

berdir’s picture

berdir’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new32.37 KB

Ok, let's see how good the access checks are that were added there :)

Status: Needs review » Needs work

The last submitted patch, 47: 2227503-47.patch, failed testing.

berdir’s picture

larowlan’s picture

Issue summary: View changes

Completed beta phase template in issue summary

larowlan’s picture

Status: Needs work » Needs review
StatusFileSize
new32.38 KB

And re-rolled whilst at it

Status: Needs review » Needs work

The last submitted patch, 51: comment-widget-formatters-2227503.51.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 51: comment-widget-formatters-2227503.51.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new35.29 KB
new1.08 KB
new32.38 KB

Install works, there's still 2 debug() calls, and form needs some love:

Status: Needs review » Needs work

The last submitted patch, 55: 2227503-comment-base-55.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new2.05 KB
new33.03 KB

Fix few tests, email widget changed (size setting, looks a feature)

Status: Needs review » Needs work

The last submitted patch, 57: 2227503-comment-base-57.patch, failed testing.

penyaskito’s picture

Status: Needs work » Needs review
StatusFileSize
new33.02 KB

Rerolled. Conflict was on comment.info.yml, not a big deal.

Status: Needs review » Needs work

The last submitted patch, 59: 2227503-comment-base-59.patch, failed testing.

penyaskito’s picture

+++ b/core/modules/comment/src/CommentForm.php
@@ -123,42 +107,16 @@ public function form(array $form, FormStateInterface $form_state) {
-    $form['author']['name'] = array(
-      '#type' => 'textfield',
-      '#title' => $this->t('Your name'),
-      '#default_value' => $author,
-      '#required' => ($this->currentUser->isAnonymous() && $anonymous_contact == COMMENT_ANONYMOUS_MUST_CONTACT),
-      '#maxlength' => 60,
-      '#size' => 30,
-    );

If we remove this, there is no author name field for anonymous users.

larowlan’s picture

Does that mean we need a new widget?

yched’s picture

Not a full review, but :

+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php
@@ -29,6 +30,7 @@ class EmailDefaultWidget extends WidgetBase {
   public static function defaultSettings() {
     return array(
+      'size' => 60,
       'placeholder' => '',
     ) + parent::defaultSettings();
   }

We have to grow a habit of updating config schemas accordingly :-) (field.widget.settings.email_default here)

larowlan’s picture

Status: Needs work » Needs review
StatusFileSize
new477 bytes

re-roll and fixes #63

larowlan’s picture

StatusFileSize
new33.23 KB

patch would help

Status: Needs review » Needs work

The last submitted patch, 65: comment-widgets-etc-2227503.64.patch, failed testing.

larowlan’s picture

Assigned: Unassigned » larowlan
larowlan’s picture

larowlan’s picture

larowlan’s picture

Status: Needs work » Needs review
larowlan’s picture

StatusFileSize
new35.11 KB

Forgot to merge

The last submitted patch, 69: comment-widgets-etc-2227503.69.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 71: comment-widgets-etc-2227503.70.patch, failed testing.

larowlan’s picture

Status: Needs work » Needs review
StatusFileSize
new56.24 KB
new5.81 KB
new36.98 KB

More work - this *just* might be green.

Now we have an issue with the admin-user seeing too many fields on the comment-add form (see screenshot).

And anytime we want to change values, we have to submit both uid and name - including when making the comment anonymous (see interdiff).

Also found that the CommentNameValidatorConstraint does a === against 0, but it's actually "0", so added a cast to the Comment::getOwnerId() method (see interdiff).

So we need to decide how to handle the duel fields and what the admin sees I think.

wim leers’s picture

Status: Needs review » Needs work

First: AWESOME work!

#2405691: CommentAccessControlHandler checks for an invalid setting (anonymous_contact) landed; so this needs a reroll.

I reviewed the patch, but couldn't find anything to complain about code-wise. However, I don't understand yet why the screenshot in #74 looks so vastly different from the comment form in HEAD? IIRC, in the other "fields & widgets" issues, we succeeded in keeping everything looking exactly the same. Why can't that be done here? (Perhaps you're saying that the next step, but that just wasn't clear to me.)

andypost’s picture

@Wim #74 explains that there only 2 problems with patch currntly:
1) for UID1 access does apply that's why we see name and uid fields both
2) patch needs some love to properly alter form widgets to keep previous look

Why can't that be done here?

shell be done :)
The problem 1) just needs more time

wim leers’s picture

#76: thanks for the clarification :) If you're stuck on anything, ping me, and I'll try to help!

andypost’s picture

discussed at irc

larowlan> andypost: actually everything tagged as 'administrativeFields' in the commentaccesscontrolhandler should not be editable if $entity->isNew()
larowlan> andypost: so when $items is NULL or $items->getEntity()->isNew() is false
andypost> larowlan, hm, probably, but comment:create() does not care about access
larowlan> andypost: right, I'm not talking about create, I'm talking about access to widgets
andypost> aha
larowlan> andypost: the widgets are shown based on CommentAccessControlHandler::checkFieldAccess
andypost> larowlan, I just about that after entity created with initial values from form, the constraints should be invalidated
larowlan> andypost: the issue is the '$administrative_fields' should only be editable if the entity has been saved
larowlan> andypost: but you're right, we'd need default values for all of those - for REST as well

So
1) default values for fields
2) fix checkFieldAccess()
3) tune-up form
4) check test coverage

jibran’s picture

Issue tags: +Needs reroll
andypost’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new32.26 KB

no interdiff, merged manually

a lot of code gone in comment form

Status: Needs review » Needs work

The last submitted patch, 80: 2227503-comment-base-80.patch, failed testing.

wim leers’s picture

Thanks for pushing this forward again!

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.9 KB
new33.19 KB

Fixed tests except CommentBlockTest no idea why getSubject returns nothing

Status: Needs review » Needs work

The last submitted patch, 83: 2227503-comment-base-83.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new4.63 KB
new34.59 KB

Here's few more fixes, still failed tests:
1) subject is not generated from comment body (CommentBlockTest shows that)
2) CommentTranslationUITest because now there's 2 fields (uid and name) still and changing name does not change author

Status: Needs review » Needs work

The last submitted patch, 85: 2227503-comment-base-85.patch, failed testing.

wim leers’s picture

Getting closer! :)

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new4.67 KB
new33.99 KB

Subject still needs generation, added access for elements

Maybe file separate issue to discuss UI regression - now there's 2 fields Name and Author?

Status: Needs review » Needs work

The last submitted patch, 88: 2227503-comment-base-87.patch, failed testing.

larowlan’s picture

Maybe file separate issue to discuss UI regression - now there's 2 fields Name and Author?

I thought we resolved in #78 that we could fix that with access handlers?

andypost’s picture

But access handlers does not help here because $is_admin needs both fields to allow admin change comment to anonymous and set name field

EDIT commited #2398073: Admin should not be able to edit email of authenticated commenters

siva_epari’s picture

Status: Needs work » Needs review
StatusFileSize
new29.87 KB

Patch rerolled.

siva_epari’s picture

Issue tags: +#drupalgoa2015

Patch rerolled.

Status: Needs review » Needs work

The last submitted patch, 92: 2227503-comment-base-92.patch, failed testing.

rteijeiro’s picture

Status: Needs work » Needs review
StatusFileSize
new29.39 KB

Re-rolled!

Status: Needs review » Needs work

The last submitted patch, 95: 2227503-comment-base-95.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 95: 2227503-comment-base-95.patch, failed testing.

segi’s picture

Issue tags: +Needs reroll

The last patch needs to reroll.

segi’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new29.36 KB

Here it is the rerolled patch.

Status: Needs review » Needs work

The last submitted patch, 100: 2227503-comment-base-100.patch, failed testing.

wim leers’s picture

Would be great to still get this done.

larowlan’s picture

Status: Needs work » Needs review
Issue tags: -Field API, -beta target, -D8 upgrade path +Needs upgrade path, +Needs upgrade path tests
StatusFileSize
new24.36 KB

reroll

Status: Needs review » Needs work

The last submitted patch, 103: comment-formatters-2227503.103.patch, failed testing.

yched’s picture

  1. +++ b/core/modules/comment/comment.info.yml
    @@ -5,5 +5,6 @@ package: Core
    +  - entity_reference
    

    Is that really still needed ? Most of the functionnality about ER fields now lives in core

  2. +++ b/core/modules/comment/src/CommentForm.php
    @@ -120,7 +123,32 @@ public function form(array $form, FormStateInterface $form_state) {
    +    $form['uid']['widget'][0]['target_id']['#required'] = ($this->currentUser->isAnonymous() && $anonymous_contact == COMMENT_ANONYMOUS_MUST_CONTACT);
    +    if ($this->currentUser->isAuthenticated() && !$is_admin) {
    +      $form['uid']['widget'][0]['target_id']['#type'] = 'item';
    +      $form['uid']['widget'][0]['target_id']['#value'] = $this->currentUser->id();
    +      $form['uid']['widget'][0]['target_id']['#theme'] = 'username';
    +      $form['uid']['widget'][0]['target_id']['#account'] = $this->currentUser;
    +    }
    ...
    +    $form['mail']['widget'][0]['value']['#required'] = ($this->currentUser->isAnonymous() && $anonymous_contact == COMMENT_ANONYMOUS_MUST_CONTACT);
    

    The problem with code like that is that it hardcodes on the inner structure of the widget. And the field definitions make that widget configurable/changeable in Field UI (->setDisplayConfigurable('form', TRUE);)

  3. +++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
    @@ -182,6 +182,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
             if ($this->currentUser->hasPermission('post comments')) {
    +
               $output['comment_form'] = [
    

    Needless hunk, one file less to change ;-)

catch’s picture

  1. +++ b/core/config/schema/core.entity.schema.yml
    @@ -167,6 +167,9 @@ field.widget.settings.email_default:
     
    

    This is the only thing that concerns me - I think it's probably OK before RC, but it'll break default configuration afterwards. So needs a change record, and might be good to split out to a separate major issue to do quickly.

  2. +++ b/core/modules/comment/comment.info.yml
    @@ -5,5 +5,6 @@ package: Core
    +  - entity_reference
    

    This needs an upgrade path. Also we'd be removing it again if we do the entity reference ashes scattering. Again that seems fine before RC but trickier afterwards (would really like to minimize update hooks added during RC since more people will run them and less excuses if they break).

Apart from that everything here looks eligible for a minor release, but not a patch release, so my personal opinion is if it gets in before RC then that'd be fantastic, but if it doesn't we'll need to move to 8.1.x.

Tagging RC deadline to reflect that.

catch’s picture

Issue tags: +rc deadline
yched’s picture

Also :

+++ b/core/modules/comment/src/Entity/Comment.php
@@ -262,27 +262,59 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
+      ->setSetting('handler', 'default')

Shameless plug : that line shouldn't be needed after #2578249: Some e_r fields get the wrong Selection handler

The last submitted patch, 103: comment-formatters-2227503.103.patch, failed testing.

larowlan’s picture

jonathanshaw’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -rc deadline

Changing to 8.1 per #106

jonathanshaw’s picture

jonathanshaw’s picture

Assigned: larowlan » Unassigned
Issue summary: View changes

Unassigned as not recently worked on

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lokapujya’s picture

Issue tags: +Needs reroll
vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

StatusFileSize
new21.41 KB

Hello guys,

reroll is ready

vprocessor’s picture

Assigned: vprocessor » Unassigned
Status: Needs work » Needs review
vprocessor’s picture

Issue tags: -Needs reroll

Status: Needs review » Needs work

The last submitted patch, 117: comment-formatters-2227503-117.patch, failed testing.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mohit_aghera’s picture

Status: Needs work » Needs review
StatusFileSize
new21.4 KB

Re-rolling patch for 8.3.x

Status: Needs review » Needs work

The last submitted patch, 122: comment-formatters-2227503-122.patch, failed testing.

lokapujya’s picture

+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -106,7 +105,7 @@ protected function setUp() {
+  public function postComment($entity, $comment, $subject = '', $contact = array(), $field_name = 'comment') {

So $contact should always be an array(). Because later on, on line #134:

<?php
if ($contact !== NULL && is_array($contact)) {
?>

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Issue tags: +Needs reroll
yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar
yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new20.79 KB

Complete re-roll of patch #122

yogeshmpawar’s picture

Issue tags: -Needs reroll

Status: Needs review » Needs work

The last submitted patch, 130: comment-formatters-2227503-130.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

catch’s picture

The subject field is using a widget now, but it's not using a formatter, so we should either add that here or spin-off another issue.

anas_maw’s picture

StatusFileSize
new20.79 KB

Reroll the patch in #130 to work on latest 8.6.x

larowlan’s picture

Status: Needs work » Needs review
Issue tags: +Needs issue summary update

Can we get an issue summary update of the remaining tasks here - I see refs to addressing code reviews in the current remaining tasks - have they been completed?
I also see tags for update path and tests - should we add those to the remaining tasks?

Status: Needs review » Needs work

The last submitted patch, 135: comment-formatters-2227503-135.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

adamps’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

I updated the IS to match the latest patch and to reference new issue #3090187: Mechanism to disable preprocessing of base fields in comment entity type so they can be configured via the field UI which answers #134.

andypost’s picture

Issue tags: +Needs reroll
sokru’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new20.74 KB

Just a reroll with minor coding standard fixes.

Two pointers:
1)
core/modules/comment/src/Entity/Comment.php
on baseFieldDefinitions() for $fields['uid'] with description "The user ID of the comment author" doesn't have anymore:

->setTranslatable(TRUE)
->setSetting('target_type', 'user')

wonder if they should be there. They where removed in #2949964: Add an EntityOwnerTrait to standardize the base field needed by EntityOwnerInterface.

2)
In core/modules/comment/tests/src/Functional/CommentPreviewTest.php function testCommentEditPreviewSave() makes following change

-    $edit['date[date]'] = $date->format('Y-m-d');
-    $edit['date[time]'] = $date->format('H:i:s');
+    $edit['created[0][value][date]'] = $date->format('Y-m-d');
+    $edit['created[0][value][time]'] = $date->format('H:i:s');

but keeps :

$displayed['date[date]'] = current($this->xpath("//input[@id='edit-date-date']"))->getValue();
$displayed['date[time]'] = current($this->xpath("//input[@id='edit-date-time']"))->getValue();

wonder if that's correct?

Status: Needs review » Needs work

The last submitted patch, 142: 2227503-comment-formatters-142.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

scorpionghost’s picture

// MODULENAME.module

/**
 * Implements hook_entity_base_field_info_alter().
 */
function MODULENAME_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
  if ($entity_type->id() == 'comment') {
    /** @see \Drupal\comment\Entity\Comment::baseFieldDefinitions() */
    $fields['uid']->setDisplayConfigurable('view', TRUE);
    $fields['created']->setDisplayConfigurable('view', TRUE);
  }
}

Original: http://xandeadx.ru/blog/drupal/981

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new20.65 KB

Re-roll patch crated for 9.3.x.

vsujeetkumar’s picture

StatusFileSize
new20.31 KB
new544 bytes

Fixed custom command fail issue.

larowlan’s picture

Status: Needs review » Needs work
andypost’s picture

Version: 9.3.x-dev » 9.4.x-dev
Related issues: +#2546116: Allow a sitebuilder to change the Comment form heading
catch’s picture

We should be making the comment title part of the display mode configuration as well so it can be hidden (this used to be configurable via a 'show subject' option but that's no longer in Drupal 9).

jonathanshaw’s picture

@catch The comment title is being worked on as part of #2353867: [META] Expose Title and other base fields in Manage Display, especially #3090187: Mechanism to disable preprocessing of base fields in comment entity type so they can be configured via the field UI. The complexities are mostly not specific to the entity type.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sahil.goyal’s picture

StatusFileSize
new29.94 KB
new25.9 KB

rerolling the patch for the Drupal 10.1.x version and made it compatible with the version and made some improvements to the patch, along with the patch attaching the reroll_diff, Please review it and suggest if need to update something.

sahil.goyal’s picture

Status: Needs work » Needs review
ameymudras’s picture

StatusFileSize
new30.22 KB
new3.12 KB
ameymudras’s picture

StatusFileSize
new30.22 KB
new800 bytes

Fixing the CCF

_utsavsharma’s picture

StatusFileSize
new717 bytes
new30.21 KB

Tried to fix CCF.
Please review.

smustgrave’s picture

Status: Needs review » Needs work

Seems to be having failures going back to #148

Also was previously tagged for upgrade path and upgrade test which still need to happen

Did not test issue.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.