/** * Build the sub query which is used when merging in * repeat element records from their joined table into the one field. * Overwritten in database join element to allow for building * the join to the talbe containing the stored values required ids * * @since 2.1.1 * * @return string sub query */ protected function buildQueryElementConcatId() { $str = parent::buildQueryElementConcatId(); $jointable = $this->getJoinModel()->getJoin()->table_join; $dbtable = $this->actualTableName(); $db = JFactory::getDbo(); $table = $this->getListModel()->getTable(); $fullElName = $this->getFullName(false, true, false) . "_id"; $str .= ", (SELECT GROUP_CONCAT(" . $this->_element->name . " SEPARATOR '" . GROUPSPLITTER . "') FROM {$jointable} WHERE " . $jointable . ".parent_id = " . $table->db_primary_key . ") AS {$fullElName}"; return $str; }