Welcome, Guest
Username: Password: Remember me

TOPIC: [CLOSED] Front end collections empty rows - error diagnosed

Front end collections empty rows - error diagnosed 21 May 2015 13:01 #13143

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 16
I have a front end view in RT CALLOUT called Managers Directory.

There are three test managers in the system.

Running on my local install or in sandbox, on the front end view.. the three rows are showing for the managers, but the rows are completely empty

Joomla 3.2 build in sandbox

This is NOT for all views.. but only appears to be in views set as default but with a custom alias
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
Last Edit: 21 May 2015 13:14 by MorganL. Reason: found error
The administrator has disabled public write access.

Front end collections not showing data 21 May 2015 13:10 #13144

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 16
I think this has something to do with view alias and default

The query I got in debugging is
SELECT a.id,a.created_by,a.published

  FROM p17oj_rtcallout_managers AS a

  WHERE (0 OR (a.published = 1 OR a.published IS NULL))

  ORDER BY a.ordering asc 
  LIMIT 0, 20

However the model is
case 'managers.managerdirectory':

				//BASE FIELDS
				$this->addSelect(	'a.account,'
								.	'a.mobile_number');

				//SELECT
				$this->addSelect('_account_.name AS `_account_name`');
				$this->addSelect('_account_.email AS `_account_email`');

				//JOIN
				$this->addJoin('`#__users` AS _account_ ON _account_.id = a.account', 'LEFT');

				break;

but herein lie the issue as the MODEL CALL in view.html is
$state->set('context', 'managers.default');

So the alias is managerdirectory but its the default view hence the model SHOULD say
case 'managers.default'

I made this change, and the view is now fully propegated and the new query from console is
SELECT a.id,a.created_by,a.published,a.account,a.mobile_number,_account_.name AS `_account_name`,_account_.email AS `_account_email`

  FROM p17oj_rtcallout_managers AS a

  LEFT JOIN `p17oj_users` AS _account_ 
  ON _account_.id = a.account

  WHERE (0 OR (a.published = 1 OR a.published IS NULL))

  ORDER BY a.ordering asc 
  LIMIT 0, 20
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Front end collections not showing data 21 May 2015 18:33 #13151

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Hi Morgan,

I have tried your component and everything seems ok.
Did you managed it ?


I can't find that :
case 'managers.managerdirectory':

For me it is :
case 'managers.default':

Wich is correct.
Both in front and back
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.079 seconds

Get Started