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

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started