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.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | interdiff-911630-10-20.txt | 919 bytes | chishah92 |
| #20 | add-table-doc-911630-20.patch | 1022 bytes | chishah92 |
| #10 | add_table_doc-911630-10.patch | 1023 bytes | druprad |
| #3 | add_table_doc-911630-3.patch | 1.05 KB | albert volkman |
| add_table_doc.patch | 1000 bytes | sreynen |
Comments
Comment #1
dawehner.
Comment #2
merlinofchaos commentedLet's do this for 3.x -- this only works for 2.x (files are different)
Comment #3
albert volkman commentedUpdated for 8.x-3.x
Comment #4
dawehner8.x-3.x patches should happen against core, sorry.
Comment #5
dawehnerThis is for sure helpful and looks fine in general.
Comment #6
alansaviolobo commentedComment #7
alansaviolobo commentedComment #8
mile23Documentation improvements are bug reports.
However, the patch in #3 doesn't apply:
Comment #9
dawehnerAny kind of improvement is more than welcomed!
Comment #10
drupradpatch re-rolled for comment #3
No other improvement as mentioned in #9.
Comment #11
mile23Nice, thanks.
I'd RTBC but I'm not sure about the accuracy of the documentation. Maybe @dawenher can check.
Comment #12
mile23Still applies. RTBC so someone can object. :-)
Comment #14
drupradStatus is pass in #10 for last run.. Not sure about message in #13. Re-queue for testing.
Comment #15
drupradmoving back to RTBC based on #12
Comment #16
xjmThanks 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.Comment #17
xjmComment #19
chishah92 commentedComment #20
chishah92 commentedUpdating the documentation according to D8.
Thanks!
~Chirag
Comment #28
lendudeI 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.
Comment #33
smustgrave commentedI 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?