Skip to main content

Timeline for DB Query with JOIN in Task Plugin

Current License: CC BY-SA 4.0

9 events
when toggle format what by license comment
May 23 at 7:27 comment added mickmackusa Okie dokey, I've swapped out my leftJoin() calls for join()s. Is there someone on the documentation team that can lift a finger? Or is everyone still waiting for someone else to step up?
May 23 at 7:27 history edited mickmackusa CC BY-SA 4.0
replaced leftJoin() calls
May 23 at 6:32 comment added Sharky Documentation is wrong in that it treats Joomla\Database\DatabaseAwareTrait::getDatabase() as returning a concrete Joomla\Database\DatabaseDriver class when it's actually typehinted to return Joomla\Database\DatabaseInterface. In turn, DatabaseDriver::getQuery() is documented as returning DatabaseQuery while DatabaseInterface::getQuery() returns QueryInterface. leftJoin() and other shortcut methods are present on DatabaseQuery class but not on the QueryInterface interface. These methods will not be added to the interface. They will be completely removed at some point.
May 23 at 5:25 comment added mickmackusa In the Joomla4 documentation: docs.joomla.org/… and in the J5 documentation: docs.joomla.org/J5.x:Selecting_data_using_JDatabase
May 23 at 5:19 comment added mickmackusa @Sharky was it removed? There are many old posts on JSE that used it. joomla.stackexchange.com/search?q=leftJoin
May 23 at 5:17 comment added Sharky @GlennArkell That could be because the method doesn't exist. There is no leftJoin() method on Joomla\Database\QueryInterface. Your IDE should warn you about that.
May 23 at 1:03 comment added mickmackusa It is the overly cautious advice given to all Joomlers to cover the high volume of "developers" who are novices with insufficient knowledge of security practices and how to write valid SQL queries. I assure you there is no vulnerability in this case.
May 23 at 0:13 comment added Glenn Arkell Thanks Mick, I've not picked up on the $query->leftJoin() way of doing joins before so this is very helpful. I thought using the quoteName() was the preferred way to encase tables and fields?
May 21 at 23:34 history answered mickmackusa CC BY-SA 4.0