Skip to content

Commit

Permalink
fix Util's markJsFunction function of checking '=>' exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dongnl committed Sep 11, 2023
1 parent 78dee2a commit 7cf23aa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Version 6.2.0
1. Fix Utility's arrayToDatastore function when there's only one column.
2. Update Google chart to use Date type in X axis for zoom option to work.

## Version 6.1.0
1. Fix dynamic properties in PHP 8.2.
2. Fix mull meta column key in core/Table widget.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koolreport/core",
"version":"6.1.0",
"version":"6.2.0",
"description": "An Open Source PHP Reporting Framework for easier and faster report delivery.",
"keywords": ["php reporting framework","php reporting tools","data processing","data visualization","charts and graphs"],
"homepage": "https://www.koolreport.com",
Expand Down
6 changes: 4 additions & 2 deletions src/core/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ public static function markJsFunction(&$obj, &$marks = array())
) $isJsFunction = true;
if (
strpos($tsv, "(") === 0
&& strpos($tsv, "=>") !== -1
) $isJsFunction = true;
&& strpos($tsv, "=>") !== false
) {
$isJsFunction = true;
}
if ($isJsFunction) {
$marks[] = trim($v);
$obj[$k] = "--js(" . (count($marks) - 1) . ")";
Expand Down
7 changes: 7 additions & 0 deletions src/datasources/PdoDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ protected function guessTypeFromValue($value)
protected function buildMetaData()
{
// echo "pdodatasource buildMetaData<br>";

// $this->connection->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
// $this->connection->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_BOTH);

$metaData = array("columns" => array());

if (empty($this->sqlParams)) $this->sqlParams = [];
Expand Down Expand Up @@ -562,6 +566,9 @@ public function start()
{
// echo "pdodatasource start()<br>";

// $this->connection->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
// $this->connection->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_NUM);

$this->buildMetaData();
$this->sendMeta($this->builtMetaData, $this);

Expand Down

0 comments on commit 7cf23aa

Please sign in to comment.