Strange DB behaviour with three controller params
Permalink
I'm getting weird errors from DBAL from a single page controller only when I pass 3 params to the controller, e.g. /pages/somepage/1/2/3.
The three params get assigned correctly to the three vars in the view declaration:
So that's not an issue but if I miss off the last param in the URL I get no error which is strange. The query code is:
And the error is:
Clearly arg 2 in that snippet is an array. Anyone know whats going on, is there a limit of 2 params you can pass to a controller or something and the third messes stuff up somehow?
Thanks
The three params get assigned correctly to the three vars in the view declaration:
public function view($pagenum = 1, $perpage = 20, $editid = null) {
So that's not an issue but if I miss off the last param in the URL I get no error which is strange. The query code is:
$h = $this->data->executeQuery(' select t.id, t.name, t.description, count(tq.id) as cnt from themes t left join theme_questions tq on t.id = tq.theme_id where t.deleted = 0 group by t.id order by name limit ?, ? ', [0,20], [\PDO::PARAM_INT, \PDO::PARAM_INT]);
And the error is:
Argument 2 passed to Doctrine\DBAL\Connection::executeQuery() must be of the type array, string given, called in /var/www/c5/concrete5-8.1.0/packages/.......
Clearly arg 2 in that snippet is an array. Anyone know whats going on, is there a limit of 2 params you can pass to a controller or something and the third messes stuff up somehow?
Thanks
DO NOT put a variable called $editid into your method declaration. $edit_id, it seems, is fine.