This comment and commented out code is just weird...

  /**
   * Executes the aggregate query.
   *
   * @return array
   *   A list of result row arrays. Each result row contains the aggregate
   *   results as keys and also the groupBy columns as keys:
   * @code
   * $result = $query
   *   ->aggregate('nid', 'count')
   *   ->condition('status', 1)
   *   ->groupby('type')
   *   ->executeAggregate();
   * @endcode
   * Will return:
   * @code
   * $result[0] = array('count_nid' => 3, 'type' => 'page');
   * $result[1] = array('count_nid' => 1, 'type' => 'poll');
   * $result[2] = array('count_nid' => 4, 'type' => 'story');
   * @endcode
   */
  // public function execute();

Proposed change per @alexpott in #3:

So the fix should be to remove reference to executeAggregate in comments and remove reference to poll node type as this no longer exists in core.
The commented out function was fixed in #1944768: Document QueryAggregateInterface::execute

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Component: database system » documentation
Status: Active » Needs review
FileSize
1.49 KB

Patch to remove code... and I guess this is documentation as it is just removing comments.

chx’s picture

Status: Needs review » Closed (works as designed)

Nah. We will remove the // when we go 5.3.10

alexpott’s picture

Status: Closed (works as designed) » Needs review
FileSize
1.25 KB

Ok so talking to chx on IRC the reason execute is commented out is caused by https://bugs.php.net/bug.php?id=43200 which is fixed in php 5.3.10 also see #1800122: Bump minimum version of php required to 5.3.10

So the fix should be to remove reference to executeAggregate in comments and remove reference to poll node type as this no longer exists in core.

jhodgdon’s picture

Status: Needs review » Needs work

Let's get the changelog bit out of this patch.

Also, if you are going to fix up this doc block, please fix the indentation. The whole thing with that code example and the following text is part of the @return docs, and it should all be indented two spaces.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1.36 KB

Doh! Sorry for including the changelog file...

I've indented 2 spaces after the @return and indented a further two spaces inside the @code/@endcode as this is the standard elsewhere.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon
Status: Needs review » Reviewed & tested by the community

The two-space indent inside @code is not followed consistently in Core, but it's fine either way. So this patch looks fine to me, and I'll get it committed once it turns green (I realize it's just docs but I sleep better at night if I only commit patches after they turn green. :) ).

Thanks!

chx’s picture

Status: Reviewed & tested by the community » Postponed

I am postponing this on 5.3.10. It's a mere week away, we need to touch this code anyways, why do two when it can be done in one go?

jhodgdon’s picture

Title: Remove code example that referes to non-existent function in QueryAggregateInterface » Fix code example that referes to non-existent function in QueryAggregateInterface, and uncomment function
Assigned: jhodgdon » Unassigned

OK, then fixing title and unassigning.

jhodgdon’s picture

Component: documentation » entity system

Oh, and it won't be just documentation either.

chx’s picture

Component: entity system » documentation

It will be, the only reason this function exists on the interface is to document it. There won't be any functional changes. It's just that PHP freaks out from this sort of override.

mgifford’s picture

Issue summary: View changes
Status: Postponed » Active

This was postponed for a reason which @chx said expired a year ago (I think).

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.

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

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

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

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

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

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

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

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

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

quietone’s picture

Version: 8.9.x-dev » 9.1.x-dev
Issue tags: +Bug Smash Initiative
FileSize
433 bytes
1.34 KB

Just needs a reroll.

quietone’s picture

Status: Active » Needs review
Abhijith S’s picture

Applied patch #20 . It works fine.The non-existent function is replaced with actual one

Checking patch core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php...
Applied patch core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php cleanly.

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.

Lendude’s picture

Title: Fix code example that referes to non-existent function in QueryAggregateInterface, and uncomment function » Fix code example that referes to non-existent function in QueryAggregateInterface
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Related issues: +#1944768: Document QueryAggregateInterface::execute

Updated the IS to match the fix criteria outlined in #3 and the commented out function was fixed in #1944768: Document QueryAggregateInterface::execute so took that bit out of the title.

Lendude’s picture

Issue summary: View changes
catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/lib/Drupal/Core/Entity/Query/QueryAggregateInterface.php
@@ -136,18 +136,18 @@ public function sortAggregate($field, $function, $direction = 'ASC', $langcode =
+   *   Will return:
+   *   @code
+   *     $result[0] = array('count_nid' => 3, 'type' => 'page');
+   *     $result[1] = array('count_nid' => 4, 'type' => 'story');
+   *   @endcode
    */

While we're here, I think we should change 'story' to 'article' to match what the standard profile provides.

ayushmishra206’s picture

Assigned: Unassigned » ayushmishra206
ayushmishra206’s picture

Assigned: ayushmishra206 » Unassigned
Status: Needs work » Needs review
FileSize
1.35 KB

Rerolled for 9.2.x. Please review. Also made the change suggested in #26.

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

Feedback from #26 addressed, back to RTBC

  • catch committed 1ae9564 on 9.2.x
    Issue #1923816 by alexpott, quietone, ayushmishra206, jhodgdon, chx,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1ae9564 and pushed to 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

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