Jump to content

Recommended Posts

  • Moderators
Posted

Nabeel,

I keep getting this when the maintenance cron is run,

PHP Notice: A non well formed numeric value encountered in /core/common/StatsData.class.php on line 89

This is the block,

/**
    * Get all of the months since a certain date
    */
   public static function getMonthsSinceDate($start) {
       $key_month = date('MY', $start); //This is line 89
       $key = 'months_since_' . $key_month;
       $months = CodonCache::read($key);

       if ($months === false) {
           if (!is_numeric($start)) {
               $start = strtotime($start);
           }

           $end = date('Ym');

           do {
               # Get the months
               $month = date('M Y', $start); 
               $months[$month] = $start; # Set the timestamp
               $start = strtotime('+1 month +1 day', strtotime($month));

               # Convert to YYYYMM to compare
               $check = intval(date('Ym', $start));

           } while ($check <= $end);

           CodonCache::write($key, $months, 'long');
       }

       return $months;
   }

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...