bug classes\class.templateconfig.php

Gesperrt
emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

bug classes\class.templateconfig.php

Beitrag von emergence » 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

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...
*** make your own tools (wishlist :: thx)

emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Mi 27. Apr 2005, 11:31

@timo
kannst du mir da noch was dazu sagen
-> die funktion getData liefert sämtlich werte ohne urldecode zurück...
ist das so beabsichtigt ?
*** make your own tools (wishlist :: thx)

timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo » Mi 27. Apr 2005, 12:35

keine Ahnung...ich hab das Ding weder geschrieben noch verwende ich es...ich werde den Thread mal an einen Kollegen weiterleiten

timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo » Do 20. Okt 2005, 14:37

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

emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Do 20. Okt 2005, 15:16

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 ?
*** make your own tools (wishlist :: thx)

timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo » Do 20. Okt 2005, 15:23

es wird ergänzt ;)

timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo » Mo 24. Okt 2005, 17:58

habe beides geändert - konnte es aber nicht testen...

emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Mo 24. Okt 2005, 19:01

in der contenido-cvs-2005-10-24.tar ist es ja noch nicht drinnen...
ich sehe es mir beim nächsten snapshot an...
*** make your own tools (wishlist :: thx)

emergence
Beiträge: 10641
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Mi 26. Okt 2005, 06:54

passt und läuft... ;-)
*** make your own tools (wishlist :: thx)

Gesperrt