KoolReport's Forum

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

Redeclaration of function replaceUrls #1477

Closed Alex Chartier opened this topic on on Jun 6, 2020 - 4 comments

Alex Chartier commented on Jun 6, 2020

I am calling a report multiple times within the same php context. When I do this with cloudexport I am getting a redeclaration error in file koolreport/cloudexport/vendor/chromeheadless/php-client/Exporter at line 122.

it seems the replaceUrls function is declared inside the saveTempContent function and is therefore not part of the Exporter class, so when chromeheadless is called again this function is already in the global space.

Moving the replaceUrls function to be part a function of the Exporter class and calling it with self::replaceUrls solves the problem.

Note: replaceUrls calls itself recursively so it is necessary to add the self:: to the recursive call within the function.

David Winterburn commented on Jun 8, 2020

Hi Alex,

It's a good recommendation. We will replicate and fix this issue. Thanks!

Alex Chartier commented on Jun 19, 2020

Were you able to replicate?

David Winterburn commented on Jun 22, 2020

Hi Alex,

Yes, we've been able to replicate this duplicate function isse and even found a fix for it. We've released a new version (0.7.0) for chromeheadlessio/php-client package. You could try it by updating the file cloudexport/composer.json to require the new version and run command "composer update" in cloudexport folder:

    "require": {
        "chromeheadlessio/php-client": "^0.7"
    }

Let us know if any of your problem remains. Thanks!

Alex Chartier commented on Jun 22, 2020

Yes, it appears to work. Thank you.

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
None yet

None