parameters passed to pagination, gives htmlentities error
Bug #934104 reported by
Adrian Liechti
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PHPDevShell |
Confirmed
|
High
|
TitanKing |
Bug Description
Some interresting error is happening, when i add the parameters array to the pagination.
Error:
htmlentities() expects parameter 1 to be string, array given
The array is like this:
$parameters = array(
'userId' => $this->
'removed' => 0,
'expiresAfter' => '2012-02-17 12:00:00'
);
The errorpage and the qeryfile are attached
Changed in phpdevshell: | |
milestone: | 3.2.1-stable → none |
To post a comment you must log in.
Change the query-method in the pagination-class:
public function query($sql) shift($ params) ; // first parameter of this function is query. $params[ 1])) { unshift( $paramArray, $params[0]);
{
// Get all parameters.
$params = func_get_args();
//array_
/**
* @author Adrian Liechti
* To make it Possible to give the Query-Method an Array.
*/
if (is_array(
$paramArray = $params[1];
array_
$params = $paramArray;
}
$this- >searchFilter( ); finalQuery( $params) ;
return $this->
}
But there are more problems with the pagination! The parameters are not used, because the pagination should extend the PHPDS_query-class but it doesn't extend it.
My workaround looks like this:
public function invoke($parameters = null) factory( 'pagination' );
{
$pagination = $this->
$this- >extraBuild( $parameters) ; $this-> where)) { $this-> groupby) ) {
if (!empty(
$this->sql .= "\n".'WHERE '.$this->where;
}
if (!empty(
$this->sql .= "\n".'GROUP BY '.$this->groupby;
}
$get_results = $pagination- >query( $this-> sql, $parameters);
//.........
But with this workaround you have to remove the search-function, because the pagination cannot handle the WHERE and GROUP BY etc. separately.