CRM-18397: Don't add empty billing name to non-existent billing address
[civicrm-core.git] / CRM / Event / Page / ManageEvent.php
index 86a1da1704e349ed4aa2daaad658ba044f5bfd7a..ed741659acd2491629ac4618ba7dedfb68af5b20 100644 (file)
@@ -470,13 +470,13 @@ ORDER BY start_date desc
 
         $from = $this->get('start_date');
         if (!CRM_Utils_System::isNull($from)) {
-          $clauses[] = '( start_date >= %3 OR start_date IS NULL )';
+          $clauses[] = '( end_date >= %3 OR end_date IS NULL )';
           $params[3] = array($from, 'String');
         }
 
         $to = $this->get('end_date');
         if (!CRM_Utils_System::isNull($to)) {
-          $clauses[] = '( end_date <= %4 OR end_date IS NULL )';
+          $clauses[] = '( start_date <= %4 OR start_date IS NULL )';
           $params[4] = array($to, 'String');
         }
       }