bug/incomplete code in getRecords default WHERE?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 23, 2010   (RSS)

By mjkayson - July 23, 2010

Have just been fiddling with what seems to be a bug sparked by the getRecords function (in viewer_functions.php):

This is working in a site frontend, not within the CMS - it's a simple form that submits to update a table that is part of the CMS, so the $_REQUEST superglobal is populated with various ($_POST) details from the form, which I use in an UPDATE query but I don't want them used anywhere else.

When I call getRecords( ) and pass in a WHERE clause, after a little digging around what seems to happen is that it automatically adds in a default WHERE clause though the function _createDefaultWhereWithFormInput( ), viewer_functions.php line 216.

The arguments for this are ($schema, '', $options) - and it seems (though I didn't look at it too closely) as if the second argument should be populated in order to avoid this default WHERE being added. This is just a question really - I've worked around it by storing the $_REQUEST in a class property and then setting it to an empty array, which works fine - I was just wondering what the logic behind this default WHERE clause is as it currently stands.

Re: [Jason] bug/incomplete code in getRecords default WHERE?

By mjkayson - July 23, 2010

ok great, thanks!