Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with PHP7.2 #272

Open
kevin201 opened this issue May 13, 2019 · 17 comments
Open

Problems with PHP7.2 #272

kevin201 opened this issue May 13, 2019 · 17 comments

Comments

@kevin201
Copy link

It's such a shame that this project seems to have been abandoned. It's such a great package!

I've just been through an exercise to update an old instance (2014) to work with PHP7.2, which, I think, would only require some tweaks in the composer.lock file to work again straight out of the box. (before I was getting white screens or "Warning: count(): Parameter must be an array or an object that implements Countable" errors)

I've even managed to cobble together a function in the PhpReportType.php file to enable dynamic dropdown headers from my SQL data.

I haven't found anywhere other than here where the author might be watching, (the old support forum seems to be defunct) so I thought I'd post this here in case.

@hellifiknow
Copy link

I have been able to update it to work with PHP 7.2, so I may be able to help. What version of Twig and Flight are you using?

@kevin201
Copy link
Author

kevin201 commented Jun 3, 2019

I'm not at work at the moment, but if I recall correctly the main problem was solved by relaxing the requirements in the lock file. I couldn't get Twig 2 to play, but a later version of 1.x worked ok. Any more info on what tweaks you made would be interesting.

@kevin201
Copy link
Author

kevin201 commented Jun 8, 2019

Twig: const VERSION = '1.24.1-DEV';
Flight: 1.2.20

@apropos
Copy link

apropos commented Jun 11, 2019

@kevin201 can you please post composer files that work with php 7.2?

@hellifiknow
Copy link

@kevin201 Try upgrading the version of Flight you are using to 1.3.7 and upgrade the version of Twig you are using to 1.37.1.

@apropos
Copy link

apropos commented Jun 11, 2019

I keep getting the following error.
PHP Fatal error: Cannot declare class Flight, because the name is already in use in /var/www/xxxx/vendor/mikecao/flight/flight/Flight.php on line 53

@hellifiknow
Copy link

@apropos What version of Flight are you using?

@apropos
Copy link

apropos commented Jun 11, 2019

I figured out the problem with class declaration. Removing Flight from autoload solved it.

@hellifiknow the one you suggested, 1.3.7 and Twig 1.37.1
"require": {
"twig/twig": "1.37.1",
"swiftmailer/swiftmailer": "5.",
"mikecao/flight": "1.3.7",
"jdorn/sql-formatter": "dev-master",
"jdorn/file-system-cache": "dev-master",
"phpoffice/phpexcel": "dev-develop",
"adodb/adodb-php": "dev-master",
"lespoilus/spyc": "dev-master",
"google/apiclient": "1.0.
@beta"
},

@apropos
Copy link

apropos commented Jun 11, 2019

@hellifiknow thanks for the help.
Now the problem I'm having is following.

500 Internal Server Error
Trying to get property 'report' of non-object (8)

#0 /var/www/html/xxx/data_reports/lib/PhpReports/PhpReports.php(189): flight\Engine->handleError(8, 'Trying to get p...', '/var/www/html/w...', 189, Array)
#1 /var/www/html/xxx/data_reports/index.php(82): PhpReports::displayReport('daily_gross_rep...', 'html')
#2 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(169): {closure}('html')
#3 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(145): flight\core\Dispatcher::callFunction(Object(Closure), Array)
#4 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Engine.php(340): flight\core\Dispatcher::execute(Object(Closure), Array)
#5 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(198): flight\Engine->_start()
#6 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(144): flight\core\Dispatcher::invokeMethod(Array, Array)
#7 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(49): flight\core\Dispatcher::execute(Array, Array)
#8 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Engine.php(92): flight\core\Dispatcher->run('start', Array)
#9 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(198): flight\Engine->__call('start', Array)
#10 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Flight.php(77): flight\core\Dispatcher::invokeMethod(Array, Array)
#11 /var/www/html/xxx/data_reports/index.php(102): Flight::__callStatic('start', Array)
#12 {main}

@hellifiknow
Copy link

Try clearing out the cache directory. Possibly it was cached before you updated and the cache has an old version.

@apropos
Copy link

apropos commented Jun 11, 2019

i remove the whole vendor directory and do composer update --no-dev each time.

@hellifiknow
Copy link

There is a directory that gets created named 'cache' at the same level as the vendor directory. Just run sudo rm -r cache to clear it out.

@apropos
Copy link

apropos commented Jun 11, 2019

@hellifiknow I've reinstalled php-reports and that seems to have fixed the issues. Thanks so much for the help!

@hellifiknow
Copy link

@apropos Cool! Glad I could help.

@eotin
Copy link

eotin commented Feb 19, 2020

@hellifiknow thanks for the help.
Now the problem I'm having is following.

500 Internal Server Error
Trying to get property 'report' of non-object (8)

#0 /var/www/html/xxx/data_reports/lib/PhpReports/PhpReports.php(189): flight\Engine->handleError(8, 'Trying to get p...', '/var/www/html/w...', 189, Array)
#1 /var/www/html/xxx/data_reports/index.php(82): PhpReports::displayReport('daily_gross_rep...', 'html')
#2 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(169): {closure}('html')
#3 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(145): flight\core\Dispatcher::callFunction(Object(Closure), Array)
#4 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Engine.php(340): flight\core\Dispatcher::execute(Object(Closure), Array)
#5 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(198): flight\Engine->_start()
#6 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(144): flight\core\Dispatcher::invokeMethod(Array, Array)
#7 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(49): flight\core\Dispatcher::execute(Array, Array)
#8 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Engine.php(92): flight\core\Dispatcher->run('start', Array)
#9 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/core/Dispatcher.php(198): flight\Engine->__call('start', Array)
#10 /var/www/html/xxx/data_reports/vendor/mikecao/flight/flight/Flight.php(77): flight\core\Dispatcher::invokeMethod(Array, Array)
#11 /var/www/html/xxx/data_reports/index.php(102): Flight::__callStatic('start', Array)
#12 {main}

Hi, I'm having the same issue but can't fix it. Could you please provide me some help, maybe by providing you composer file ? Thanks a lot

@apropos
Copy link

apropos commented Feb 25, 2020

Hi, I'm having the same issue but can't fix it. Could you please provide me some help, maybe by providing you composer file ? Thanks a lot

I resolved the issue by reinstalling php-reports and here's the current composer.json
{
"name": "jdorn/php-reports",
"description": "A PHP framework for displaying reports from any data source, including SQL and MongoDB",
"homepage": "http://jdorn.github.com/php-reports/",
"keywords": ["reports", "mongodb", "sql", "reporting", "csv", "database"],
"license": "LGPL-3.0+",
"authors": [
{
"name": "Jeremy Dorn",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.3",
"ext-pdo": "",
"twig/twig": "1.37.1",
"swiftmailer/swiftmailer": "5.
",
"mikecao/flight": "1.3.7",
"jdorn/sql-formatter": "dev-master",
"jdorn/file-system-cache": "dev-master",
"phpoffice/phpexcel": "dev-develop",
"adodb/adodb-php": "dev-master",
"lespoilus/spyc": "dev-master",
"google/apiclient": "1.0.*@beta"
},
"autoload": {
"files": [
"lib/adodb/pivottable.inc.php"
],
"classmap": [
"vendor/jdorn/file-system-cache/"
]
},
"minimum-stability": "dev"
}

@russell-hutson-jp
Copy link

twig 1.44.7 works for me on PHP 7.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants