I spent a while trying to figure out the right way to use $query->add_table(). This is the documentation I wish I'd had.

Comments

dawehner’s picture

Status: Active » Needs review

.

merlinofchaos’s picture

Version: 6.x-2.8 » 6.x-3.x-dev
Status: Needs review » Needs work

Let's do this for 3.x -- this only works for 2.x (files are different)

albert volkman’s picture

Version: 6.x-3.x-dev » 8.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.05 KB

Updated for 8.x-3.x

dawehner’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Documentation » views.module

8.x-3.x patches should happen against core, sorry.

dawehner’s picture

This is for sure helpful and looks fine in general.

alansaviolobo’s picture

Issue summary: View changes
Status: Needs review » Needs work
alansaviolobo’s picture

Status: Needs work » Needs review
mile23’s picture

Category: Feature request » Bug report
Status: Needs review » Needs work
Issue tags: +Needs reroll

Documentation improvements are bug reports.

However, the patch in #3 doesn't apply:

$ git apply add_table_doc-911630-3.patch 
error: core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php: No such file or directory
dawehner’s picture

Any kind of improvement is more than welcomed!

druprad’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1023 bytes

patch re-rolled for comment #3

No other improvement as mentioned in #9.

mile23’s picture

Issue tags: +Documentation

Nice, thanks.

I'd RTBC but I'm not sure about the accuracy of the documentation. Maybe @dawenher can check.

mile23’s picture

Status: Needs review » Reviewed & tested by the community

Still applies. RTBC so someone can object. :-)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 10: add_table_doc-911630-10.patch, failed testing.

druprad’s picture

Status: Needs work » Needs review

Status is pass in #10 for last run.. Not sure about message in #13. Re-queue for testing.

druprad’s picture

Status: Needs review » Reviewed & tested by the community

moving back to RTBC based on #12

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the documentation improvement!

However, there is not anything called add_relationship() anymore, so the documentation is not correct in some way at least. (Not surprising since the initial issue report was 5 years ago.) So let's have someone look into this more and see if it is still more or less accurate in D8, and how to update it.

xjm’s picture

Issue tags: +VDC

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.

chishah92’s picture

Assigned: Unassigned » chishah92
chishah92’s picture

Status: Needs work » Needs review
StatusFileSize
new1022 bytes
new919 bytes

Updating the documentation according to D8.

Thanks!
~Chirag

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.

lendude’s picture

Title: Improve $query->add_table documentation » Improve $query->addTable $relationship parameter documentation
Version: 8.9.x-dev » 9.2.x-dev
Assigned: chishah92 » Unassigned
Category: Bug report » Task

I think doc updates are task nowadays.

The doc update, I think, just points out one way to fix this if adding a table doesn't work. If there is only one join missing, that might work, but maybe there is a problem further up the tree and then this won't work either. Maybe just add a @see to \Drupal\views\Plugin\views\query\Sql::ensurePath ? Although the doc block on that isn't really comprehensive either.

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.

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

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

I like the idea for #28 to add an @see and maybe open a followup to update Sql::ensurePath(), if still needed.

Seems like the more correct solution thoughts?

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.