Open qwasyx0 opened 1 year ago
We have added support for 8.2 version. You can update from the following link: https://packagist.org/packages/stimulsoft/reports-php#dev-master
or wait new release build 2023.1.7 in this week.
If the problem persists in the new version, please open the ticket again.
Thank you for quick response, unfortunately I am not able to use the designer component on php8.2 with firebird.
Proposed fix:
<?php
namespace Stimulsoft\Adapters;
use Stimulsoft\StiDataResult;
use Stimulsoft\StiResult;
class StiFirebirdAdapter extends StiDataAdapter
{
// ...
protected function getValue($type, $value)
{
if (is_null($value) || strlen($value) == 0)
return null;
switch ($type) {
case 'array':
return base64_encode($value);
case 'datetime':
$timestamp = strtotime($value);
$format = date("Y-m-d\TH:i:s.v", $timestamp);
if (strpos($format, '.v') > 0) $format = date("Y-m-d\TH:i:s.000", $timestamp);
return $format;
case 'time':
$timestamp = strtotime($value);
$format = date("H:i:s.v", $timestamp);
if (strpos($format, '.v') > 0) $format = date("H:i:s.000", $timestamp);
return $format;
case 'string':
return mb_convert_encoding($value, 'UTF-8', mb_list_encodings()); // <- fix deprecated function
// return utf8_encode($value); // <- current vesion
}
return $value;
}
// ...
}
Second problem:
<?php
namespace Stimulsoft\Adapters;
use Stimulsoft\StiConnectionInfo;
use Stimulsoft\StiDatabaseType;
use Stimulsoft\StiDataResult;
use Stimulsoft\StiResult;
class StiDataAdapter
{
// ...
private function detectType($value)
{
// if (preg_match('~[^\x20-\x7E\t\r\n]~', $value) > 0) // <- current version
if (is_array($value)) // <- fixed but still fails somewhere else
return 'array';
if (is_numeric($value)) {
if (strpos($value, '.') !== false) return 'number';
return 'int';
}
if (\DateTime::createFromFormat('Y-m-d H:i:s', $value) !== false ||
\DateTime::createFromFormat('Y-m-d', $value) !== false ||
\DateTime::createFromFormat('Y-M-d', $value) !== false ||
\DateTime::createFromFormat('H:i:s', $value) !== false)
return 'datetime';
if (is_string($value))
return 'string';
return 'array';
}
// ...
}
After that I am unable to debug as I work mainly with PHP and the designer shows "Connection error", sometimes the fields of given IA_PREDPROT view are imported, but it is not consistent.
Hopefully this helps to fix the issue.
Also I am unable to re-open the issue as I was not the one who closed it.
Thanks for the clarification. We have accepted your fix, the task has been submitted for testing, the fix will soon be publicly available.
Hello, I am trying to run the package on a Laravel application which uses php 8.2.
I am getting some errors (already messaged stimulsoft support via email).
I wasn't able to show the designer or view because of the error linked under. On local development I was running 8.1 and all was alright, when I switched to 8.2, I'm getting these errors.
Will your package support newest php 8.2?
The error shown is in StiDataAdapter.php:
Also other error I was able to debug in StiLicense.php:
The stacktrace: