kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

PHP Warning 'yii\base\ErrorException' with message 'count(): Parameter must be an array or an object that implements Countable' #74

Closed antoha-p closed 5 years ago

antoha-p commented 6 years ago

When forming the PDF I get the warning from php:

PHP Warning 'yii\base\ErrorException' with message 'count(): Parameter must be an array or an object that implements Countable' in /var/www/yii2.collector.local/vendor/mpdf/mpdf/classes/otl.php:5840

Operating System: Linux
PHP Version: 7.2.3

How do I solve this problem

http://php.net/manual/en/function.count.php Starting with version 7.2, the function of the count(NULL) now produces a warning. Therefore, in the line in the place specified in the warning, before the function count @, then it works fine.

$len = @count($cOTLdata['char_data']);

Will there be any further support for this powerful tool for version 7.2?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.