Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
Issue tags: +VDC-cleanup
FileSize
4.59 KB

Adding some tests for add_fields, so you can be sure the method works as expected.

dawehner’s picture

Issue tags: -VDC, -VDC-cleanup

#1: drupal-1933286-1.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +VDC, +VDC-cleanup

The last submitted patch, drupal-1933286-1.patch, failed testing.

dawehner’s picture

Issue tags: -VDC-cleanup +Novice
reszli’s picture

Assigned: Unassigned » reszli
Issue summary: View changes
Issue tags: - +Needs reroll

patch does not apply anymore, rerolling...

reszli’s picture

Status: Needs work » Needs review
Issue tags: -Novice, -Needs reroll
FileSize
3.86 KB

attached is the rerolled patch
the function was already renamed from clear_fields into clearFields,
but it still needed the other changes

Status: Needs review » Needs work

The last submitted patch, 6: 1933286_6.patch, failed testing.

reszli’s picture

Issue tags: +Needs tests

patch now applies correctly, but the new test introduces needs a complete rewrite

reszli’s picture

FileSize
3.82 KB

let's see if this fixes the problem with the test

reszli’s picture

FileSize
641 bytes

forgot to attach the interdiff

reszli’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: 1933286_9.patch, failed testing.

reszli’s picture

FileSize
3.85 KB
1.81 KB

attached new patch
fixed tests, they succeded locally

reszli’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
jhedstrom’s picture

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

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
3.86 KB

Status: Needs review » Needs work

The last submitted patch, 16: 1933286-16.patch, failed testing.

rpayanm’s picture

Status: Needs work » Needs review
FileSize
889 bytes
3.87 KB
jhedstrom’s picture

  1. +++ b/core/modules/views/src/Plugin/views/query/Sql.php
    @@ -776,8 +776,7 @@ public function addField($table, $field, $alias = '', $params = array()) {
    -   * Remove all fields that may've been added; primarily used for summary
    -   * mode where we're changing the query because we didn't get data we needed.
    +   * Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::clearFields().
    

    We should use {@inheritdoc} instead of the overrides bit.

  2. +++ b/core/modules/views/src/Tests/Plugin/QuerySqlTest.php
    @@ -0,0 +1,73 @@
    \ No newline at end of file
    

    Needs a line break here.

jhedstrom’s picture

Note that {@inheritdoc} could just be added to the existing docblock comment, since specifying what the method is doing seems valuable.

rpayanm’s picture

FileSize
1.01 KB
4.15 KB

Status: Needs review » Needs work

The last submitted patch, 21: 1933286-21.patch, failed testing.

Status: Needs work » Needs review

rpayanm queued 21: 1933286-21.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 21: 1933286-21.patch, failed testing.

dawehner’s picture

mhhh ... so QueryPluginBase does not have the notion of fields at all, at the moment.
So I wonder whether it really makes sense to have such a generic method on there.

Status: Needs work » Needs review

rpayanm queued 21: 1933286-21.patch for re-testing.

dawehner’s picture

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

At that point its a 8.1.x thing, this is for sure.

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.

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.

dawehner’s picture

+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -776,8 +776,7 @@ public function addField($table, $field, $alias = '', $params = array()) {
   /**
-   * Remove all fields that may've been added; primarily used for summary
-   * mode where we're changing the query because we didn't get data we needed.
+   * Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::clearFields().
    */
   public function clearFields() {

@@ -1615,7 +1614,7 @@ public function aggregationMethodDistinct($group_type, $field) {
   /**
-   * Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::getDateField().
+   * @inheritdoc
    */
   public function getDateField($field) {

Let's use {@inheritdoc}, but also ensure that we don't change the second instance ... this is not needed to fix this particular issue, or actually is kinda more unrelated.

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.

Lendude’s picture

Title: Move clear_fields to the query plugin base, as it's maybe used on other query examples » Improve docs for \Drupal\views\Plugin\views\query\Sql::clearFields and add test coverage
Category: Bug report » Task
FileSize
2.56 KB

Per #25, I agree that we shouldn't add this to the base class, since that has no concept of fields.

So changing this to a task to just update the doc block and add test coverage for the clearFields method because that is still relevant.

Updated the patch in #21:
* Removed the changes to QueryPluginBase
* Updated the test to run on PHPUnit

No interdiff cause that wouldn't be useful, everything has changed.

Lendude’s picture

Issue tags: +Bug Smash Initiative

This came up as a bug smash initiative daily target, so tagging it as such

Lendude’s picture

Fixed the namespace for the test

Lendude’s picture

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.

smustgrave’s picture

Running for D10

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Document changes look good and (I think) would pass short doc when that lands.

Adding test coverage seems like a welcomed addition.

Code looks good not sure what else to check.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 45: 1933286-44.patch, failed testing. View results

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.