]> git.agnieray.net Git - galette.git/commitdiff
Fix tempalte issue when contribution end date is missing on php 8.1
authorJohan Cwiklinski <johan@x-tnd.be>
Thu, 9 Jun 2022 04:49:34 +0000 (06:49 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Thu, 9 Jun 2022 04:49:34 +0000 (06:49 +0200)
galette/lib/Galette/Entity/Contribution.php

index 579a43e59814fea57bdba2c0644c21895d61d582..dc2c3a08db0c9e5c45a57a2391fe938c9d488508 100644 (file)
@@ -1223,7 +1223,7 @@ class Contribution
                         // Caution : the end_date stored is actually the due date.
                         // Adding a day to compute the next_begin_date is required
                         // to return the right number of months.
-                        $next_begin_date = new \DateTime($this->_end_date);
+                        $next_begin_date = new \DateTime($this->_end_date ?? $this->_begin_date);
                         $next_begin_date->add(new \DateInterval('P1D'));
                         $begin_date = new \DateTime($this->_begin_date);
                         $diff = $next_begin_date->diff($begin_date);