laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.39k stars 680 forks source link

[Proposal] Update dompdf/dompdf to 0.8.0 to fix PDF Invoice ErrorException using PHP 7.1 #386

Closed waitem closed 7 years ago

waitem commented 7 years ago

Laravel Spark v4.0.5 (using Laravel/Cashier 7.0.6) produces an error exception when trying to display an team invoice:

ErrorException in Table.php line 577:
A non-numeric value encountered
in Table.php line 577
at HandleExceptions->handleError(2, 'A non-numeric value encountered', '/home/vagrant/crimcram/vendor/dompdf/dompdf/src/FrameReflower/Table.php', 577, array('style' => object(Style), 'columns' => array(array('x' => 0, 'min-width' => 163.0, 'max-width' => 163.0, 'used-width' => null, 'absolute' => 163.0, 'percent' => 0, 'auto' => false), array('x' => 0, 'min-width' => 154.494, 'max-width' => 271.719, 'used-width' => null, 'absolute' => 0, 'percent' => 0, 'auto' => true)), 'i' => 1, 'dims' => array(0, 0, '0', '0', 'auto', 'auto', '2px'), 'delta' => 'auto')) in Table.php line 577
at Table->get_min_max_width() in Table.php line 407
at Table->reflow(object(Block)) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow(object(Block)) in Block.php line 738
at Block->reflow(object(Block)) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow(object(Block)) in Block.php line 738
at Block->reflow(null) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow() in Page.php line 133
at Page->reflow(null) in AbstractFrameDecorator.php line 801
at AbstractFrameDecorator->reflow() in Dompdf.php line 834
at Dompdf->render() in Invoice.php line 263
at Invoice->pdf

Cashier currently requires 0.7.x of dompdf/dompdf.

The problem appears to be resolved with v0.8.0 of dompdf/dompdf. See: github issue

This proposal is to update the version number of dompdf/dompdf in cashier's composer.json to ^0.8.0

faustbrian commented 7 years ago

@waitem Did you find a way to force install dompdf 0.8? Running into the same issue at the moment.

waitem commented 7 years ago

@faustbrian Sorry, no. Beyond my skill level I'm afraid! Hoping that either a) we get a new version of laravel/cashier, or b) someone else can show how to temporarily override the dompdf/dompdf version in laravel/cashier's composer.json until the new version comes out.

faustbrian commented 7 years ago

Just ended up cloning cashier locally and loading it that way instead of from packagist

waitem commented 7 years ago

OK, I have seen that a fix has been made to the 7.0 branch a few days ago: commit

Until a new 7.0.x release is made, I was able to resolve this issue by making the following changes to my composer.json:

    "require": {
         ...
          "laravel/cashier": "7.0.x@dev",
          ...
    }
   ...
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/laravel/cashier.git"
        }
    ]

and then running composer update