Strange Lister->getIterator() behaviour

21 views
Skip to first unread message

Daniel Tosello

unread,
Apr 3, 2014, 9:33:03 PM4/3/14
to agile-too...@googlegroups.com
Hi all,

I'm exploring ATK4 as a rapid deployment framework for academic datasets. Since many of our researchers are used to an Access->MS SQL pathway (and i'm a unix/web oriented guy with a bunch of existing infrastructure in place), I decided to extend dsql to handle MSSQL via dblib/freeTDS. This actually worked fairly well considering my lack of experience with the framework and I'll release it after i override all the $bt entries (MS SQL likes '[' and ']').

So far i have it tested and working with CRUD and Grid, but I came across a rather weird bug when deploying to my test server (PHP5.4 on RHEL). When using Paginator with Grid I would get a 'No matching records found' result, but the pagination reflected the number of records that should have been returned. I assumed this was a problem with my implementation of the database interface, but in testing i found that the database was loading records appropriately. Further testing led me to find that if i alter Lister->getIterator() the whole thing works (wth, of course, an unwanted echo)... and i can't quite work out why apart from speculating about variable scope or async db timing or something.

    function getIterator()
   
{
        echo
(' dq : ' . $this->dq); //why does this fix iteration?

       
if (is_null($i = $this->model ?: $this->dq ?: $this->iter)) {
           
throw $this->exception('Please specify data source with setSource or setModel');
       
}
       
return $i;
   
}


Does anyone have any idea what might be causing this, and how to solve it in a less obtrusive way?

Thanks :)
--Daniel

Daniel Tosello

unread,
Apr 3, 2014, 11:12:28 PM4/3/14
to agile-too...@googlegroups.com
Upon further testing it appears it is actually the concatenation of the $this->dq var that is resolving the problem. I still haven't worked out exactly what is causing the problem, and am open to suggestions.

--Daniel
Reply all
Reply to author
Forward
0 new messages