Seite 1 von 1

bug classes\class.templateconfig.php

Verfasst: So 17. Apr 2005, 10:46
von emergence
hab mich ein wenig mit der kasse beschäftigt und bin da auf einen bug gestossen...

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;
	}
ä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....

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);
		}

	}
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...

Verfasst: Mi 27. Apr 2005, 11:31
von emergence
@timo
kannst du mir da noch was dazu sagen
-> die funktion getData liefert sämtlich werte ohne urldecode zurück...
ist das so beabsichtigt ?

Verfasst: Mi 27. Apr 2005, 12:35
von timo
keine Ahnung...ich hab das Ding weder geschrieben noch verwende ich es...ich werde den Thread mal an einen Kollegen weiterleiten

Verfasst: Do 20. Okt 2005, 14:37
von timo
also das mit dem urldecode ist richtig...aber beim ersten Punkt hab ich keine Ahnung

werde ich auch mal so übernehmen, soweit ich das in Erfahrung bringen konnte haben wir die Klasse bei keinem Projekt im Einsatz

Verfasst: Do 20. Okt 2005, 15:16
von emergence
timo hat geschrieben:also das mit dem urldecode ist richtig
ähm wie meinst du das ?
es ist richtig das es fehlt oder es gehört ergänzt ?

Verfasst: Do 20. Okt 2005, 15:23
von timo
es wird ergänzt ;)

Verfasst: Mo 24. Okt 2005, 17:58
von timo
habe beides geändert - konnte es aber nicht testen...

Verfasst: Mo 24. Okt 2005, 19:01
von emergence
in der contenido-cvs-2005-10-24.tar ist es ja noch nicht drinnen...
ich sehe es mir beim nächsten snapshot an...

Verfasst: Mi 26. Okt 2005, 06:54
von emergence
passt und läuft... ;-)