Hallo!
Ich habe ein Problme mit tt_address. Ich möchte zur jeweiligen Adresse auch die Gruppe (tt_address_group) per TS anzeigen lassen.
lib.shared.components.addresslist = TEMPLATE
lib.shared.components.addresslist {
userFunc = tx_ttaddress_pi1->main
# We load the template. Beacause our template has multiple sub-templates, we tell it which subpart we are
# going to work on right now.
template = FILE
template.file = fileadmin/templates/ext/tt_address/addresslist.html
workOnSubpart = template_AddressList
subparts {
# Substitute the subpart named 'subpart_Address' with a CONTENT object
subpart_Address = CONTENT
subpart_Address {
table = tt_address
select {
orderBy = last_name ASC
pidInList = 46
}
# Again we use a template and assing the required subpart
renderObj = TEMPLATE
renderObj {
template = FILE
template.file = fileadmin/templates/ext/tt_address/addresslist.html
workOnSubpart = subpart_Address
# Let's assign some markers!
marks {
Firstname = TEXT
Firstname.field = first_name
Firstname.htmlSpecialChars = 1
Lastname = TEXT
Lastname.field = last_name
Lastname.htmlSpecialChars = 1
Lastname = TEXT
Lastname.field = last_name
Lastname.htmlSpecialChars = 1
Organization = TEXT
Organization.field = company
Organization.htmlSpecialChars = 1
#####Problem####
Grouplist = CONTENT
Grouplist {
table = tt_address_group
select {
selectFields = title
# pidInList = 46
# where = tt_address_group.uid = tt_address_group_mm.uid_foreign
# andWhere = tt_address.uid = tt_address_group_mm.uid_local
join = tt_address_group_mm ON ( tt_address_group.uid = tt_address_group_mm.uid_foreign )
#where = tt_address_group.deleted=0 AND tt_address_group.hidden=0 AND tt_address_group_mm.uid_local = 46
# select g.title, a.name from tt_address_group g, tt_address a, tt_address_group_mm m where g.uid = m.uid_foreign and a.uid = m.uid_local;
}
renderObj = TEXT
renderObj {
field = title
wrap = |
}
}
#####Problem####
# We just generate the link, no A-tag wrap
Link = TEXT
Link.typolink {
parameter.data = TSFE:id
additionalParams.dataWrap = &ts_addresslist[showUid]={field:uid}&type=5000
returnLast = url
# The cache hash is needed to display the right content, since we are not running as USER_INT
useCacheHash = 1
}
}
}
}
}
# The stdWrap will overwrite the object in case we are viewing a detail (condition at the bottom)
stdWrap.override.cObject = CONTENT
stdWrap.override.cObject {
table = tt_address
select {
andWhere.data = GP:ts_addresslist|showUid
# Make sure there is no SQL injection!
andWhere.intval = 1
andWhere.wrap = uid=|
orderBy = last_name ASC
pidInList = 46
}
# Again we use a template and assing the required subpart
renderObj = TEMPLATE
renderObj {
template = FILE
template.file = fileadmin/templates/ext/tt_address/addresslist.html
workOnSubpart = template_AddressList_Detail
# Let's assign some markers!
marks {
Photo = IMAGE
Photo.file {
import = uploads/pics/
import.field = image
import.listNum = 0
maxH = 640
maxW = 640
}
Firstname = TEXT
Firstname.field = first_name
Firstname.htmlSpecialChars = 1
Lastname = TEXT
Lastname.field = last_name
Lastname.htmlSpecialChars = 1
Fund = TEXT
Fund.field = dateofbirth
Fund.date = Y-m-d
Organization = TEXT
Organization.field = company
Organization.htmlSpecialChars = 1
Email = TEXT
Email.field = email
Telephone = TEXT
Telephone.field = phone
Description = TEXT
Description.field = description
Description.htmlSpecialChars = 1
BackLink = TEXT
BackLink.typolink {
parameter.data = TSFE:id
returnLast = url
}
}
}
}
# Make sure the detail view is only displayed if there is actually a showUid specified
stdWrap.override.if {
isTrue.data = GP:ts_addresslist|showUid
isTrue.intval = 1
}
}
plugin.tx_ttaddress_pi1 < lib.shared.components.addresslist
Ich bekomme folgende Fehler im FE:
Uncaught TYPO3 Exception
#1310027933: DBAL fatal error: No handler found in handler_getFromTableList() for: "tt_address_group JOIN tt_address_group_mm ON ( tt_address_group.uid = tt_address_group_mm.uid_foreign )" (SQL engine parse ERROR: No join field found in parseFromTables()!: near "( tt_address_group.uid = tt_address_group_mm.uid_f") (More information)
RuntimeException thrown in file
/var/www/typo3_src-6.1.5/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php in line 2865.
63 TYPO3\CMS\Dbal\Database\DatabaseConnection::handler_getFromTableList("tt_address_group JOIN tt_address_group_mm ON ( tt_…ress_group.uid = tt_address_group_mm.uid_foreign )")
/var/www/typo3_src-6.1.5/typo3/sysext/dbal/Classes/Database/DatabaseConnection.php:
01162: */
01163: public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {
01164: $this->lastHandlerKey = $this->handler_getFromTableList($from_table);
01165: $hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
01166: if ($hType === 'adodb' && $this->runningADOdbDriver('postgres')) {
62 TYPO3\CMS\Dbal\Database\DatabaseConnection::SELECTquery("title, tt_address_group.uid as uid, tt_address_group.pid as pid", "tt_address_group JOIN tt_address_group_mm ON ( tt_…ress_group.uid = tt_address_group_mm.uid_foreign )", "tt_address_group.pid IN (23) AND tt_address_group.…p) OR FIND_IN_SET('-1',tt_address_group.fe_group))", "", "", "")
/var/www/typo3_src-6.1.5/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:
07515: unset($queryPartValue);
07516: }
07517: $query = $GLOBALS['TYPO3_DB']->SELECTquery($queryParts['SELECT'], $queryParts['FROM'], $queryParts['WHERE'], $queryParts['GROUPBY'], $queryParts['ORDERBY'], $queryParts['LIMIT']);
07518: return $returnQueryArray ? $queryParts : $query;
07519: }
61 TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getQuery("tt_address_group", array, boolean)
/var/www/typo3_src-6.1.5/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:
07379: */
07380: public function exec_getQuery($table, $conf) {
07381: $queryParts = $this->getQuery($table, $conf, TRUE);
07382: return $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
Danke für jeden Hinweis!
lg Gernot