Two things requested:

  1. Make read() return a traversable object instead of an array (better resource usage. See below for story.)
  2. Change arguments of crud functions as follows:
    create($entity, $fields(config objects))  -> ($entity, $field_names*)
    update($comment)                          -> ($entity, $field_names*)
    read($entities, $entity_type, $accurate*) -> ($entity_type, $entities, $field_names*, $accurate*)
    delete($entity)                           -> ($entity, $field_names*)
    larowlan #8: add deleteMultiple($entity_type, $entity_ids, $field_names*)
    
    (* = optional. $entity means 'commented/parent entity'.)
    

We can still clean up the interface now because it's fresh enough that noone 'external' is using it yet.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it makes the code more performant and improves the interface
Unfrozen changes Unfrozen because it only changes an interface that is unlikely to be used outside of core comment module
Prioritized changes The main goal of this issue is performance
Disruption Not disruptive for core/contributed and custom modules/themes because it is unlikely to be used outside core comment module - possibly only in MongoDb

Justification

Constraints imposed by practical usage

  • read() is the most important method in this service and should keep an array as the first argument for speed. (Each time I look at this I want to change ($entities, $entity_type) to ($entity_ids, $entity_type) to make things less redundant... but then I see the definition of hook_entity_storage_load(). So I have no opinion on that.)
  • CommentStatistics::update() inserts a record if one does not exist. That means we cannot, at the moment, delete statistics records for an entity before deleting its comments; that would recreate the record.

Detailed changes

  • read - adding $field_names: it's quite possible that someone making a website with multiple comment fields, wants to read (maybe a lot of) statistics for only one of the fields. Also: DX/the presence of this parameter implicitly reminds you that the return value can hold multiple records for the same entity. (Forgetting this led to my mess-up re #1.)
  • delete/update - adding $feld_names: it's possible that you only want to delete records for one field name as well. Adding it to update() isn't that important, but: adds consistency (DX).
  • create - replacing the field-definition-config objects by their machine names: for unification with other methods, and because it's highly unlikely any service implementation will need the objects. (The current code does not use them.)
  • create - making the field_names optional: because we can; because of consistency with other methods and we don't want to make it required on all the methods, that would be a pain.
  • update - changing to ($entity, $field_names): because of consistency; from a code perspective there is no reason why this method should have different arguments than create(); also, having $comment falsely gives the impression that you should call this method for each comment individually, if you do mass operations (e.g. delete) on comments attached to the same entity.
  • delete these comments are superseded by larowlan's #8 suggestion; ...I'm not sure about this. It seems like
    • we will at some point want to be able to delete all the records for an entity_type + field_name combination, i.e. for all entities. This patch doesn't actually implement that; it just makes it so you could implement something special like e.g. array(0) to mean "all entities".
    • loading full entities in order to delete related data, seems a bit strange. (In comment_field_instance_config_delete(), we would not have the entities yet, only the IDs from an EntityQuery.)

    But if anyone wants to keep the method signature to ($entity, $field_names), I'll change that back.

Patch details

  • The change in update() adds a 10-line code block + a foreach that starts with a 3-line if{}, near the top. The rest of the code didn't change, it was just indented.
  • The test: I found working code that mocked 'iterator methods' on http://stackoverflow.com/questions/15907249/mocking-an-iterator-class-wi..., and not inside the D8 source code, so copied it. Without changing, so it's 'too complete' now. I have no idea if that can be done better, so have at it if you want.
  • CommentStatisticsInterface::read() adds back some comments deleted from CommentStorageInterface::updateEntityStatistics() by #2280861: CommentStatistics service followup.

Remaining tasks

Make CommentStatistics language aware, as noted around #2428795-94: Translatable entity 'changed' timestamps are not working at all. This should be done in a new issue.

Original issue text / point 1

Earlier, I filed an issue #2259209: Fix CommentStatistics::read() because I wanted read() to return an array like the interface documentation said it does.

Well, that was kinda silly. Since I was keying the array by entity_id, it led to the bug which is solved by #2292115: Comment statistics is no correctly loaded into entity object if more than 1 comments field.

Unfortunately I did not see that last issue until it was fixed. Because

  • returning a non-keyed array has no real advantage over returning an iterator
  • returning an array takes more processing power and memory (it's conceivable that you want to get a lot of statistics data

...so I'd like to restore the situation to before these two issues were applied :-p ...except the interface documentation should be amended. Right now, we can still be sure we can change the interface without penalty.

Comments

roderik’s picture

Issue summary: View changes
roderik’s picture

StatusFileSize
new6.59 KB
new1.42 KB

test cleanup

roderik’s picture

Issue summary: View changes
Issue tags: +API clean-up
StatusFileSize
new10.85 KB
new5.75 KB

Separate issue (but merged into here anyway)

(Let me know if you like #2 but not this addition / you like them separated.)

While coding, It occurred to me that

  • I would probably not have made the mistake in #2259209 if I had seen a $field_names parameter on read();
  • it is very much possible that someone making a website with multiple comment fields, wants to read (maybe a lot of) statistics for only one of the fields
  • ...or delete statistics for only one of the fields **

So I'm requesting these things be added as method arguments. Also, unify create: $fields has no use, we can make it just $field_names without problem.

TODO: make tests. (I need someone to at least say yes before I do this ;) )

** "hey wait a minute", TODO: check what happens right now when one comment field is deleted. Are statistics deleted? Of one field only?

roderik’s picture

StatusFileSize
new1.38 KB
new10.86 KB

Added typehint, from review dawehner in #2280861-18: CommentStatistics service followup

roderik’s picture

Status: Needs review » Needs work

preempting testbot fail now #2280861 is in, will reroll (may take some days)

roderik’s picture

StatusFileSize
new11.22 KB

"a few days", oops...

Rerolled. I hope we can get this interface change in soon - theoretically it's now a compatibility break with what was committed 18 days ago...

roderik’s picture

Title: Redo CommentStatistics::read() » Redo CommentStatisticsInterface
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new26.34 KB
new20 KB

...and while I was writing a summary 2 weeks ago, I stumbled into a question. And another issue.

Now, my proposal has grown into a fuller interface overhaul. Changed summary.

larowlan’s picture

  1. +++ b/core/modules/comment/comment.module
    @@ -194,6 +194,9 @@ function comment_field_instance_config_delete(FieldInstanceConfigInterface $inst
    +    // TODO delete comment statistics. After #2338457 gets fixed we may have a
    +    //      list of entity IDs here, to pass to CommentStatistics::delete().
    +    //      Until then: unimportant, since the above always deletes 0 comments.
    

    Lets leave this for the dedicated issue

  2. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,69 @@ public function __construct(Connection $database, AccountInterface $current_user
    +  public function delete(array $entity_ids, $entity_type, array $field_names = array()) {
    +    if ($entity_ids && $entity_type) {
    +      $query = $this->database->delete('comment_entity_statistics')
    +        ->condition('entity_id', $entity_ids, 'IN')
    +        ->condition('entity_type', $entity_type);
    +      if ($field_names) {
    +        $query->condition('field_name', $field_names, 'IN');
    +      }
    +      $query->execute();
    +    }
    

    this feels to me like we need both a delete (as in HEAD) and a deleteMultiple (as per this patch)

  3. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,69 @@ public function __construct(Connection $database, AccountInterface $current_user
    +      // This means $field_names are attached to this entity type, but we still
    +      // need to check this for the specific entity('s bundle).
    

    maybe merge this with the // Skip fields that entity does not have comment lower down?

  4. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -178,84 +198,100 @@ public function getRankingInfo() {
    +      // This means $field_names are attached to this entity type, but we still
    +      // need to check this for the specific entity('s bundle).
    

    same?

  5. +++ b/core/modules/comment/src/CommentStatisticsInterface.php
    @@ -28,34 +27,57 @@ public function getRankingInfo();
    +   *   The name(s) of the comment field(s) to read statistics for. If not
    +   *   specified / if there are multiple comment fields on the entity which
    +   *   have statistics, multiple records per entity are returned for each field.
    ...
    +   *   The name(s) of the comment field(s) whose statistics records to delete.
    +   *   If not specified, all records for the specified ids will be deleted.
    ...
    +   * @param array $field_names
    +   *   The name(s) of the comment field(s) whose statistics records to updated.
    +   *   If not specified, all records for the entity will be updated.
    
    @@ -73,13 +95,14 @@ public function update(CommentInterface $comment);
    +   * @param array $field_names
    +   *   The name(s) of the comment field(s) which are defined for the entity
    +   *   type. Separate statistics records will be inserted for each field name.
    

    Needs (optional) at start.

  6. +++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
    @@ -91,6 +82,81 @@ protected function setUp() {
    +   * Sets up methods required to mock an iterator
    +   *
    +   * @param \PHPUnit_Framework_MockObject_MockObject $iteratorMock The mock to attach the iterator methods to
    +   * @param array $items The mock data we're going to use with the iterator
    +   * @return \PHPUnit_Framework_MockObject_MockObject The iterator mock
    +   */
    +  protected function mockIterator(\PHPUnit_Framework_MockObject_MockObject $iteratorMock, array $items) {
    

    This is awesome - should be part of UnitTestCase so other modules/tests can use it.

Status: Needs review » Needs work

The last submitted patch, 7: comment-statistics-2318875-7.patch, failed testing.

roderik’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new27.07 KB
new8.26 KB

deleteMultiple: ha, good one - then also developers won't get the delete() signature wrong.

Implemented with NULL meaning 'any', as e.g. Entity::loadMultiple() does.
(If read() should now be readMultiple, I'll hear it - I have no opinion.)

(Plus copypasted some getMock() / expects() stuff for the test bot.)

Status: Needs review » Needs work

The last submitted patch, 10: comment-statistics-2318875-9.patch, failed testing.

andypost’s picture

+++ b/core/modules/comment/src/CommentStatisticsInterface.php
@@ -58,15 +58,28 @@ public function read(array $entities, $entity_type, array $field_names = array()
-  public function delete(array $entity_ids, $entity_type, array $field_names = array());
+  public function deleteMultiple(array $ids, $entity_type, array $field_names = array());

if this changing now, lets move entity_type before IDs
Any reason for this method? no usage...

roderik’s picture

Status: Needs work » Needs review
Related issues: +#2338457: comment_field_config_delete() does not delete comments
StatusFileSize
new6.6 KB
new27.92 KB

if this changing now, lets move entity_type before IDs

OK, but then let's do read() too. I like it this way better too, though it differs from the order in hook_entity_storage_load(etc) which calls CommentStatistics::read()...

Any reason for this method? no usage...

There will be usage: #2338457-7: comment_field_config_delete() does not delete comments (also see review block 8.1 above)

Further, the test failures in #10 which are a bit worrying. From the interdiff:

@@ -293,9 +293,11 @@ function _tracker_add($nid, $uid, $changed) {
  */
 function _tracker_calculate_changed($node) {
   $changed = $node->getChangedTime();
-  $latest_comment = \Drupal::service('comment.statistics')->read(array($node), 'node', array(), FALSE);
-  if ($latest_comment && $latest_comment->last_comment_timestamp > $changed) {
-    $changed = $latest_comment->last_comment_timestamp;
+  $statistics = \Drupal::service('comment.statistics')->read('node', array($node), array(), FALSE);
+  foreach ($statistics as $record) {
+    if ($record->last_comment_timestamp > $changed) {
+      $changed = $record->last_comment_timestamp;
+    }
   }
   return $changed;
 }

This is a bugfix (buggy code inserted by me in #2068331: Convert comment SQL queries to the Entity Query API). $latest_comment was an array of arrays, is now a database statement-result-thingy, $latest_comment->last_comment_timestamp also did not exist before the fix but still the test did not throw errors.

-    \Drupal::service('comment.statistics')->update($this->getCommentedEntity(), array($this->getFieldName()));
+    $entity = $this->getCommentedEntity();
+    if (!empty($entity)) {
+      \Drupal::service('comment.statistics')->update($entity, array($this->getFieldName()));
+    }

This is to shut up test migrations. These can in some cases insert 'stub entities' - which do not have an entity_id.

It feels like a cop out because it's not wrong for this code to assume that an entity_id always exists on postSave. (Or is it?)
I have an idea that Migrate will run into similar issues, and how it should be fixed (I will have a try at it), but I might be totally wrong... so for now, this seemed like the most practical thing to do.

Status: Needs review » Needs work

The last submitted patch, 13: comment-statistics-2318875-13.patch, failed testing.

roderik’s picture

Status: Needs work » Needs review
StatusFileSize
new709 bytes
new27.92 KB

search/replace fail

roderik’s picture

larowlan’s picture

Issue summary: View changes
larowlan’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,83 @@ public function __construct(Connection $database, AccountInterface $current_user
    +      if ($ids) {
    

    This doesn't seem to be optional - so passing an empty array here (which will return FALSE) will delete all records? That seems wrong.

  2. +++ b/core/modules/comment/src/CommentStatisticsInterface.php
    @@ -28,34 +27,70 @@ public function getRankingInfo();
    +  public function deleteMultiple($entity_type, array $ids, array $field_names = array());
    

    Not seeing any test coverage for this

larowlan’s picture

Issue summary: View changes
roderik’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new30.29 KB
new5.17 KB

18.1 actually I think we want to be able to return 'all records' (at least for a certain field name), for cleanup. But I now made it such that you need to actively pass NULL for that.

(Which now makes it do what the interface spec actually said. Which is almost but not fully to Entity::loadMultiple() calls, because NULL is the default value there and cannot be actively passed to the function.)

18.2 OK, added some test. (Plus deleted an almost-unrelated Comment::load() call which really is not necessary.)

Note: first hunk of the interdiff only reverts a change present in patch #15.

Status: Needs review » Needs work

The last submitted patch, 20: comment-statistics-2318875-19.patch, failed testing.

andypost’s picture

Current code affected too, filed #2422443: Fix default value of author in \Drupal\comment\CommentStatistics::create()

+++ b/core/modules/comment/src/CommentStatistics.php
@@ -68,35 +66,82 @@ public function __construct(Connection $database, AccountInterface $current_user
+    // Get the user ID from the entity if it's set, or default to the
+    // currently logged in user.
+    $last_comment_uid = 0;
+    if ($entity instanceof EntityOwnerInterface) {
+      $last_comment_uid = $entity->getOwnerId();
+    }
+    if (!isset($last_comment_uid)) {
+      // Default to current user when entity does not implement
+      // EntityOwnerInterface or author is not set.
+      $last_comment_uid = $this->currentUser->id();
+    }

this is a current bug in code, just copy/paste.
$last_comment_id never get current user ID

roderik’s picture

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

Fairly trivial reroll. It will probably fail as andypost indicated in #22, but at least it's rerolled. Let the testbot tell whether anything else is off.

Status: Needs review » Needs work

The last submitted patch, 23: comment-statistics-2318875-23.patch, failed testing.

andypost’s picture

Failed with
Undefined property: Drupal\comment\Tests\CommentStatisticsTest::$web_userDrupal\comment\Tests\CommentStatisticsTest->testCommentNodeCommentStatistics() Drupal\simpletest\TestBase->run(Array) simpletest_script_run_one_test('116', 'Drupal\comment\Tests\CommentStatisticsTest') Notice CommentStatisticsTest.php 122

andypost’s picture

+++ b/core/modules/comment/src/CommentStatistics.php
@@ -68,35 +66,82 @@ public function __construct(Connection $database, AccountInterface $current_user
+    $last_comment_uid = 0;

please remove this line

roderik’s picture

Status: Needs work » Needs review
StatusFileSize
new30.26 KB
new1.82 KB

@ #25:
Yes, I should have tested this old issue locally first. Interdiff does

  • fix: replacing $this->web_user by $this->webUser
  • fix: provide correct arguments to the read() call in the test. (It needs the array keys.) This fixes the failure from #20
  • two small cleanups in my test code (unnecessary loop and assignment)

@ #26:
You already made a new issue for that. You are right these need unit tests (I'll try to work on them). But let's then fix this bug (delete this line) in that issue.

andypost’s picture

Status: Needs review » Needs work
Issue tags: +Performance
Parent issue: » #2371331: [META] Comment/Forum/History roadmap
Related issues: +#2304939: Stop loading comment statistics into entity object

Anther round on review, mostly to follow 8.x.

  1. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,82 @@ public function __construct(Connection $database, AccountInterface $current_user
    +    if (!$field_names) {
    +      $map = $this->entityManager->getFieldMapByFieldType('comment');
    +      $entity_type = $entity->getEntityTypeId();
    +      if (!isset($map[$entity_type])) {
    +        return;
    +      }
    +      $field_names = array_keys($map[$entity_type]);
    
    @@ -180,84 +213,99 @@ public function getRankingInfo() {
    +    if (!$field_names) {
    +      $map = $this->entityManager->getFieldMapByFieldType('comment');
    +      $entity_type = $entity->getEntityTypeId();
    +      if (!isset($map[$entity_type])) {
    +        return;
    +      }
    +      $field_names = array_keys($map[$entity_type]);
    ...
    -    $this->entityManager->getStorage($comment->getCommentedEntityTypeId())->resetCache(array($comment->getCommentedEntityId()));
    +    $this->entityManager->getStorage($entity->getEntityTypeId())->resetCache(array($entity->id()));
    

    2 places uses same code - there's comment manager getFields() method for that

  2. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,82 @@ public function __construct(Connection $database, AccountInterface $current_user
    +    $last_comment_uid = 0;
    +    if ($entity instanceof EntityOwnerInterface) {
    +      $last_comment_uid = $entity->getOwnerId();
    +    }
    +    if (!isset($last_comment_uid)) {
    

    just needs ELSE

  3. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -68,35 +66,82 @@ public function __construct(Connection $database, AccountInterface $current_user
    +    // Default to REQUEST_TIME when entity does not have a changed property.
    +    $last_comment_timestamp = REQUEST_TIME;
    

    Request time should be taken from server vars, to allow unit-testing https://www.drupal.org/node/2463059

roderik’s picture

Issue summary: View changes
StatusFileSize
new32.56 KB
new4.2 KB

Reroll and incorporated points #1 / #3 above.

For #2, there is #2422443: Fix default value of author in \Drupal\comment\CommentStatistics::create().

A @todo was inserted mentioning this issue. (ref: #2428795-94: Translatable entity 'changed' timestamps are not working at all.) IMHO his should be done in a separate issue, however. (It needs adjustments to the storage schema.) So I removed the issue number from the code.

roderik’s picture

Status: Needs work » Needs review

.

Status: Needs review » Needs work

The last submitted patch, 29: comment-statistics-2318875-29.patch, failed testing.

roderik’s picture

Status: Needs work » Needs review
StatusFileSize
new33.28 KB
new735 bytes

Great, my small change to Comment::postSave again uncovers a seemingly unrelated bug in a Migrate test.

I'll let the testbot work for me. If this goes green, I'll probably split the interdiff out into a separate issue and come up with a good description.

Status: Needs review » Needs work

The last submitted patch, 32: comment-statistics-2318875-32.patch, failed testing.

roderik’s picture

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

MigrateDrupal6TestBase has changed. So: undoing the interdiff from #32 and letting the testbot decide if there are still not-directly-related failures here.

Status: Needs review » Needs work

The last submitted patch, 35: comment-statistics-2318875-35.patch, failed testing.

roderik’s picture

Status: Needs work » Needs review
StatusFileSize
new31.93 KB
new1.85 KB

OK good - the changes to core simplify this patch a little bit.

Now the unrelated test failure (in migrate) has gone away, we are back to the situation in #29.

With, obviously, the added difficulty that APIs are frozen. So this may be left untouched for a long time. (I guess that's a point that will be addressed in other comment related issues as well, so just waiting for the outcome of those...)

andypost’s picture

queued to test with postgres
in general changes makes sense, API changes could be minified but anyway requires BC to be commited in 8.x minors

OTOH we need to solve related #2495087: comment_entity_storage_load() is too expensive on cold caches first, to make sure that we have optimal statistics loading, then decide which arguments are really needed for the service

Also we can add new implementation of service with different name and leave BC wrapper in old service

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should 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.

andypost’s picture

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

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.

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.

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.

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.

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.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.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.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.

andypost’s picture

  1. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -57,46 +62,96 @@ class CommentStatistics implements CommentStatisticsInterface {
    +  public function create(FieldableEntityInterface $entity, array $field_names = array()) {
    

    if we change interface then better to pass request object here (with fallback to \Drupal::request()

  2. +++ b/core/modules/comment/src/CommentStatistics.php
    @@ -57,46 +62,96 @@ class CommentStatistics implements CommentStatisticsInterface {
    +    $last_comment_timestamp = $_SERVER['REQUEST_TIME'];
    +    // @todo Make comment statistics language aware and add some tests.
    +    if ($entity instanceof EntityChangedInterface) {
    

    it got rework in #2422443: Fix default value of author in \Drupal\comment\CommentStatistics::create()

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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new151 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

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.