Möchte man einen Teaser sortiert nach Veröffentlichungsdatum ohne Startartikel anzeigen lassen, so erhält man nur eine leere Ausgabe und eine Fehlermeldung im errorlog
Code: Alles auswählen
[28-Oct-2010 15:30:18] xxx/contenido/external/backendedit/front_content.php?area=con_editcontent&idart=28&idcat=32〈=1&action=20&client=1&contenido=2f9dabdf1676b120aac13fd6bde0b6b6 MySQL error 1054: Unknown column 'a.publisheddate' in 'order clause'
SELECT
a.idart,
a.idartlang,
c.is_start
FROM
con_art_lang AS a,
con_art AS b,
con_cat_art AS c
WHERE
c.idcat = 32 AND
b.idclient = 1 AND
b.idart = c.idart AND
a.idart = b.idart AND
a.idlang = 1 AND a.online = 1 ORDER BY a.publisheddate desc
[28-Oct-2010 15:30:18] xxx/contenido/external/backendedit/front_content.php?area=con_editcontent&idart=28&idcat=32〈=1&action=20&client=1&contenido=2f9dabdf1676b120aac13fd6bde0b6b6 next_record called with no query pending in Module ID 15.
Wählt man nun im Teaser aber "mit Startartikel" aus, so kommt es zumindest zu einer Listenanzeige, welche halt nicht nach dem Veröffentlichungsdatum sortiert ist.
Also habe ich mich mal auf die Suche begeben wo den da ein so unterschiedliches Verhalten herkommt. Zuerst wurde ich fündig in contenido/classes/class.cms_teaser.php Zeile 1011 ff. Dort wird je nach gesetzer Auswahl Startartikel eine andere Funktion in der Klasse Contenido_Category_Articles, die man in ../contenido/classes/Contenido_Category/Contenido_Category_Articles.class.php findet, aufgerufen.
Die aufgerufene Funktion bei "ohne Startartikel" heißt getNonStartArticlesInCategory() und genau dort passiert dann das Malheur.
Code: Alles auswählen
public function getNonStartArticlesInCategory($iCategoryId, $sOrderBy = 'created', $sOrderDirection = 'DESC', $bArticleIdAsKey = false) {
if (!in_array(strtolower($sOrderDirection), array('asc', 'desc'))) {
$sOrderDirection = 'DESC';
}
$sOrderBy == 'sortsequence' ? $sOrderBy = 'artsort' : null;
$sOrderBy == 'modificationdate' ? $sOrderBy = 'lastmodified' : null;
$sOrderBy == 'creationdate' ? $sOrderBy = 'created': null;
Code: Alles auswählen
public function getNonStartArticlesInCategory($iCategoryId, $sOrderBy = 'created', $sOrderDirection = 'DESC', $bArticleIdAsKey = false) {
if (!in_array(strtolower($sOrderDirection), array('asc', 'desc'))) {
$sOrderDirection = 'DESC';
}
if($sOrderBy != 'created') {
switch ($sOrderBy) {
case 'sortsequence':
$sOrderBy = 'artsort';
break;
case 'modificationdate':
$sOrderBy = 'lastmodified';
break;
case 'creationdate':
$sOrderBy = 'created';
break;
case 'publisheddate':
$sOrderBy = 'published';
break;
default:
$sOrderBy = 'created';
}
}
Gruß aus Franken
Ortwin