Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: flypages with different sql request

flypages with different sql request 09 Apr 2014 16:50 #12402

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Hi admin,

so I troubleshoot my custom code problem, and I will try to resume:

This page starts the debug from views/portee/view.html.php where I add my custom code as described before.

http://liubov.net/joomla32/porteesattendues/portee/porteattendue?cid=748
  • I have a doubt about the constructor name "com_jbreeding.pedigrees.porteattendue", because there is no relative context/layout in pedigrees. Is it a problem ?
  • as you can see, the build query works fine (addselect, addquery, etc) ... But at final, $query is 'null'.
  • In function getListQuery(), I add an exit; just before the return $query to stop the process here
  • If I remove the exit;, Jdatabase failed in 'Invalid query' because of 'null'
hoping it is clear enough !

Here, you can see the debug with a good getListQuery() : http://liubov.net/joomla32/porteesattendues
The administrator has disabled public write access.

flypages with different sql request 21 Apr 2014 14:41 #12410

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
Hi admin and cookers ...

This is the results my search :

Subject : In an Item_view, how to get datas list from another TABLE:
views\portee\view.html.php
	// Initialiase custom code to get previous puppies from TABLE Pedigrees.
	$model_pedigrees = CkJModel::getInstance('pedigrees', 'JbreedsimpleModel');
		
	// set ModelPedigrees context
	$model_pedigrees->Setstate('context', 'pedigrees.previouspups');
		
	// set the WHERE Clause reference to Item_view
	$model_pedigrees->addWhere("a.pere = " . (int) $item->etalon) ;
	$model_pedigrees->addWhere("a.mere = " . (int) $item->lice) ;
		
	// execute the query.select and get the datas list
	$this->items	= $items	= $model_pedigrees->getItems();

works fine !
Last Edit: 21 Apr 2014 14:47 by liubov.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.131 seconds

Get Started