KoolReport's Forum

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

How do I solve the Koolreport Dashboard error on Laravel 9, #2693

Open AyandaM opened this topic on on May 23, 2022 - 5 comments

AyandaM commented on May 23, 2022

this error comes when I upgrade to laravel 8 or 9, and using php7.4 or 8.1

strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated Line: 79 File: /home/ayanda/Work/Analyz/vendor/koolreport/dashboard/Util.php

This are the package version "koolreport/core": "^5.6.0", "koolreport/dashboard": "^3.5.0", "koolreport/pro": "5.16.2"

KoolReport commented on May 23, 2022

Let go to file dashboard/Util.php line 77 and replace the function convertToSecond with the following:

    static function convertToSeconds($strTime)
    {
        if($strTime==null) {
            return 0;
        } else if (strpos($strTime, "sec")>0) {
            return intval($strTime);
        } elseif (strpos($strTime, "min")>0) {
            return intval($strTime) * 60;
        } elseif (strpos($strTime, "hour")>0 || strpos($strTime, "hr")>1) {
            return intval($strTime) * 60 * 60;
        } elseif (strpos($strTime, "day")>0) {
            return intval($strTime) * 24 * 60 * 60;
        } else {
            return $strTime;
        }
    }

Let me know if it solves the issue.

AyandaM commented on May 23, 2022

Thanks for the help, but I'm not sure you mean this /vendor/koolreport/dashboard/Util.php?

KoolReport commented on May 23, 2022

Yes, that correct.

AyandaM commented on May 23, 2022

Thanks its solved that error but suddenly I get this one

Message: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated Line: 19 File: /vendor/koolreport/dashboard/fields/Text.php

KoolReport commented on May 25, 2022

I talked to dev.team and they said that PHP 8.1 has deprecated passing null as parameter to a lot of functions. And dev.team is working on that. Currently, if possible, please use php8.0

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
help needed

Dashboard