bug classes\class.templateconfig.php
Verfasst: So 17. Apr 2005, 10:46
hab mich ein wenig mit der kasse beschäftigt und bin da auf einen bug gestossen...
da gibts die nette interne funktion
ähm, ich denke mal es wäre beabsichtigt, dass falls keine konfiguration beim artikel zugeordnet ist, die idtplcfg der kategorie zurückgeliefert wird...
wenn keine zugeordnet ist ist beim artikel der wert idtplcfg = 0 gespeichert...
so nützt einem die klasse einfach nichts...
ich würde empfehlen diese funktion zu nehmen....
fehler ist vorhanden in 4.4.x - CVS_HEAD
zusätzlich gibts ja noch was nettes, was mir aufgefallen ist...
die funktion getData liefert sämtlich werte ohne urldecode zurück...
ist das so beabsichtigt ?
d.h. mit den werte kann man erst arbeiten wenn jeder einzelne mittels urldecode nachbearbeitet wurde...
da gibts die nette interne funktion
Code: Alles auswählen
/**
* get template config id by article id
* returns false if the article has no configuration
*
* returns the template configuration for the current article
* if the article has not a template configuration it will return the configuration
* for the current category
*
* @param integer $idart id of the article which configuration should be get
*
* @return string returns the template configuration
*/
function _getTplCfgByArtId($idart)
{
$sql = "
SELECT
idtplcfg
FROM ".$this->cfg['tab']['art_lang']."
WHERE
idart=".$idart."
AND
idlang=".$this->lang;
//query
$this->db->query($sql);
if ($this->db->next_record())
{
return $this->db->f("idtplcfg");
}
else
{
$idcat = $this->_getIdCatByIdArt($idart);
return $this->_getTplCfgByCatId($idcat);
}
return false;
}
wenn keine zugeordnet ist ist beim artikel der wert idtplcfg = 0 gespeichert...
so nützt einem die klasse einfach nichts...
ich würde empfehlen diese funktion zu nehmen....
Code: Alles auswählen
/**
* get template config id by article id
* returns false if the article has no configuration
*
* returns the template configuration for the current article
* if the article has not a template configuration it will return the configuration
* for the current category
*
* @param integer $idart id of the article which configuration should be get
*
* @return string returns the template configuration
*/
function _getTplCfgByArtId($idart)
{
$sql = "
SELECT
idtplcfg
FROM ".$this->cfg['tab']['art_lang']."
WHERE
idart=".$idart."
AND
idlang=".$this->lang;
//query
$this->db->query($sql);
if (!$this->db->next_record())
{
return false;
}
if ($this->db->f("idtplcfg") != 0)
{
return $this->db->f("idtplcfg");
}
else
{
$idcat = $this->_getIdCatByIdArt($idart);
return $this->_getTplCfgByCatId($idcat);
}
}
zusätzlich gibts ja noch was nettes, was mir aufgefallen ist...
die funktion getData liefert sämtlich werte ohne urldecode zurück...
ist das so beabsichtigt ?
d.h. mit den werte kann man erst arbeiten wenn jeder einzelne mittels urldecode nachbearbeitet wurde...