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

TOPIC:

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

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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.

liubov.net/joomla32/porteesattendues/por...orteattendue?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() : liubov.net/joomla32/porteesattendues

Please Log in or Create an account to join the conversation.

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

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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 !

Please Log in or Create an account to join the conversation.

Last edit: by liubov.
  • Page:
  • 1
  • 2
Time to create page: 0.129 seconds

Les générateurs de code je les connais presque tous pour les avoir essorés en long en large et en travers ... mais celui ci c'est vraiment un outil formidable de simplicité et d'efficacité !
Marc. (liubov - Forum)

Get Started