Fields in 2 multi record loaders

emmexx 14 Aug, 2013
I use 2 DB multi record loaders to create a summary table from 2 db tables.

My setup was working ok until a few days ago. Now I get a php memory error when loading the form with those 2 multi record loaders. I suppose the problem is caused by the great number of fields in one of the tables and the number of records in the 2nd table. Those 2 combined give way to an array of data too big.

So I tried to limit the number of fields loaded by one of the multi record loaders. Until now I had left the fields field empty.
The problem is that I get no record as a result when I add one field name to the fields field (sorry).
I could get some result by adding the fields in a weird format:
table1`.`cf_uid,table1`.`cf_modified,table1`.`cf_created

but that doesn't work if I set the Group Model Data to yes (and I need it set to yes).

Is there a workaround to limit the fields returned by the DB multi record loader?

Thank you
maxx
GreyHead 19 Aug, 2013
Hi Maxx,

It may be possible but my short answer here is that as soon as things get complicated with the DB Multi-Record Loader switch to using a Custom Code action with a MySQL query instead as you then have full control over the query. The code will be something like this.
<?php
$db =& JFactory::getDBO();
$query = "
  SELECT ``
    FROM `#__`
    WHERE `` = '' ;
";
$db->setQuery($query);
$form->data['xxx'] = $db->loadAssocList();
?>

Bob
emmexx 19 Aug, 2013

It may be possible but my short answer here is that as soon as things get complicated with the DB Multi-Record Loader switch to using a Custom Code action with a MySQL query instead as you then have full control over the query.



I agree.
This time I removed one of the DB Multi Record Loaders and substituted the join with a joomla query.

Anyway I think there's a bug in the way the multi record loader manages the field names. In my tests I got queries (in the debugger) with duplicated table names. Table names are added differently in the 2 joined tables so the result is a mess.

Thank you
maxx
This topic is locked and no more replies can be posted.