Error Using $listModel->getRow() in Cron together with "limit" in content plugin

lcollong

FabriKant d'applications web
Hi,

To reproduce the error :

first :
Use the following code in the "php code" part of a newly created Php Cron plugin on whatever list (see snapshot) :

Code:
$machin = $listModel->getRow(36); // or whatever row

echo "<br>result : <pre>";print_r($machin); echo "</pre>";

It works very well both on back-end manual run and front-end automatic scheduled run.

Second :
On a detail view template of whatever form just add a content plugin somewhere in the default.php file of the template : {fabrik view=list id=2}

So the result would be the detail view of the selected record together with the rows of the content plugin list.
It works very well

Now, if you add a "limit" clause to show only some rows : {fabrik view=list id=2 limit=2}, each time you display the detail view and the cron is run (set to run every 15 seconds for test purpose), you'll get an error :

Unknown column 'f_xxxxx.2' in 'where clause'

where f_xxxxxx is the table you've selected in the cron plugin (or the first one if none selected) and ".2" is the value of the limit clause in the placeholder....

It seems that the getRow function is messing up somewhere with the content plugin containing a limit clause.
 

Attachments

  • Capture.PNG
    Capture.PNG
    45.1 KB · Views: 20
Well done ! It was really breaking our site.
Took me also a couple of hours to figure out where it came from ;-)
Thanks.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top