]> git.agnieray.net Git - galette.git/commitdiff
Fix checks on db results on some cases
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 12 Feb 2017 15:39:23 +0000 (16:39 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 12 Feb 2017 15:39:23 +0000 (16:39 +0100)
galette/lib/Galette/Core/Picture.php
galette/lib/Galette/Entity/Adherent.php
galette/lib/Galette/Entity/Contribution.php

index fbf581de6fb4703a618b5b4b00ea4aa2c71f6f29..25643fd93bdc2b72f5748195ea51af9f034c404f 100644 (file)
@@ -193,7 +193,7 @@ class Picture implements FileInterface
             $results = $zdb->execute($select);
             $pic = $results->current();
             //what's $pic if no result?
-            if ( $pic !== false ) {
+            if ( $pic ) {
                 // we must regenerate the picture file
                 $file_wo_ext = $this->store_path . $this->id;
                 file_put_contents(
index cdba12278069b15b557e85f421974496d8ab5987..a9685ef71be61cc85af53cf204de97a83ddfb1ab 100644 (file)
@@ -1118,7 +1118,7 @@ class Adherent
 
                             $results = $zdb->execute($select);
                             $result = $results->current();
-                            if ( $result !== false ) {
+                            if ( $result ) {
                                 $errors[] = str_replace(
                                     array(
                                         '%s',
index eb2993e585ff9601f5a136edf25700aa3ae986a9..8e9d3f4a7a04fb97b35f9bdaa540d255090a3f9a 100644 (file)
@@ -489,7 +489,7 @@ class Contribution
 
             $results = $zdb->execute($select);
             $result = $results->current();
-            if ( $result !== false ) {
+            if ( $result ) {
                 $d = new \DateTime($result->date_debut_cotis);
 
                 return _T("- Membership period overlaps period starting at ") .