Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18103

Warning in Pledge.php caused by null initial_reminder_day

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.11
    • Fix Version/s: 4.7.4
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      DateTime::modify(): Failed to parse time string (-day) at position 0   [warning]
      (-): Unexpected character Pledge.php:979
      
      if (empty($details['reminder_date'])) {
                $nextReminderDate = new DateTime($details['scheduled_date']);
                $nextReminderDate->modify("-" . $details['initial_reminder_day'] . "day"); // line 979
                $nextReminderDate = $nextReminderDate->format("Ymd");
              }
      

      When Pledge > Payment Reminders > Send Initial Reminder (currently an optional field) is not set, the above block of code will generate a warning, because it is trying to perform the operation "-day" instead of say, "-2 day" or "-0 day".

      Suggestion that we should not be processing reminder dates if these Payment Reminders are not set in the database. Or at the very least, perform this type of check:

      if(!isset($details['initial_reminder_day'])
        $details['initial_reminder_day'] = 0;
      

        Attachments

          Activity

            People

            • Assignee:
              rohan1990 Rohan Ramesh Katkar
              Reporter:
              aedisongsl Adam Edison
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: