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.076 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started