bug classes\class.templateconfig.php

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

bug classes\class.templateconfig.php

Beitrag 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...
*** make your own tools (wishlist :: thx)
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag 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 ?
*** 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 »

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 »

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: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag 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 ?
*** 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 »

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 »

habe beides geändert - konnte es aber nicht testen...
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag 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...
*** make your own tools (wishlist :: thx)
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence »

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