KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Passing mutiple parameters error #2093

Closed Kay opened this topic on on May 19, 2021 - 4 comments

Kay commented on May 19, 2021

I am unable to use multiple parameters. When I access only one of the any parameters passed to query it works, however, accessing two or more parameters I get the following error:

uksort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero 

This is my code sample: this works

$this->src("pgsql")
             ->query("select * from test.users where test_code=:test_code and operator_code='op01' ")
             ->params(array(
                 ":test_code"=>$this->params["test_code"]
             ))
             ->pipe($this->dataStore("test"));

this doesn't

$this->src("pgsql")
             ->query("select * from test.users where test_code=:test_code and operator_code=:operator ")
             ->params(array(
                 ":test_code"=>$this->params["test_code"],
                ":operator"=>$this->params["operator"]
             ))
             ->pipe($this->dataStore("test"));

Can you please help me on this? Thank You!

Sebastian Morales commented on May 20, 2021

Kay, are you using PHP 8.0? Tks,

Kay commented on May 20, 2021

Yes

Sebastian Morales commented on May 20, 2021

Kay, we will make a fix for this in the next version release. Meanwhile you could apply a fix yourself like this. Open the file koolreport/core/src/datasources/PostgreSQLDataSource.php (assuming you are using PostgreSQLDataSource, if not pls open your corresponding datasource class file) and replace all for the following command:

    return strlen($k1) < strlen($k2);

with this:

    if (strlen($k1) == strlen($k2)) return 0;
    else return strlen($k1) < strlen($k2) ? 1 : -1;

Let us know how this works for you. Tks,

Kay commented on May 20, 2021

Thank you it's working now but I had to change the koolreport/core/src/datasources/PdoDataSource.php

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

Laravel