Jump to content

Recommended Posts

When the CRON job runs the following error happens:

 A non well formed numeric value encountered in ..........VMS/core/common/StatsData.class.php on line 171

It continues running and does the following"

  • Reset PIREP Counts
  • Updating Total Hours Count (question is always shows "found 1 flight hours for number" regardless of number of hours a pilot has - is this correct?)
  • Now counting from PIREPS - Found 125774:08:00 total hours, updated

Any fixes for the error?

 

Share this post


Link to post
Share on other sites

167      * Get all of the months since a certain date
168     */
169    public static function getMonthsSinceDate($start) {
170 
171      $key_month = date('MY', $start);
172        $key = 'months_since_' . $key_month;
173        $months = CodonCache::read($key);

Share this post


Link to post
Share on other sites

I guess the start date is coming messed up... maybe add an

echo $start;

above that line and see what happens

Share this post


Link to post
Share on other sites

I added that line "echo $start; on line 170 and the result is the same.

A non well formed numeric value encountered in ..........VMS/core/common/StatsData.class.php on line 171

Share this post


Link to post
Share on other sites
20 minutes ago, Nabeel said:

Right but did it output anything?

See the Pm I send you with the full message.  Also how do I contact you on Discort just installed it?

 

Share this post


Link to post
Share on other sites

It's best to keep it here in case it helps anyone else. Was there an output from the $start? What if you run the script "by hand" on the command line?

Share this post


Link to post
Share on other sites
1 hour ago, Nabeel said:

It's best to keep it here in case it helps anyone else. Was there an output from the $start? What if you run the script "by hand" on the command line?

Output is the same with and w/o $start

 

When run manually here is what shows:

  1. in /var/www/vhosts/,,,,,,.com/test.,,,,,,,.com/core/common/StatsData.class.php on line 171
  2. Reset PIREP Counts - list of pilots
  3. Updating Total Hours Count - calculating hours this OK
  4. Now counting from PIREPS - OK  Found 127473:46:00 total hours, updated

When CRON is run this is the message that system sends:

Notice: A non well formed numeric value encountered in /var/www/vhosts/,,,,,,.com/test.,,,,,,,.com/core/common/StatsData.class.php on line 171
        <div id="codon_crit_error"
            style="font-family: 'Lucida Sans',Verdana;border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;">
            <h1 style="font-family: verdana; font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0;">An Error Was Encountered</h1>
            <p style="font-size: 16px; color: #001B6B">Unauthorized access - Invalid Permissions.</p>
            <p style="font-size: 10px;"><center><a href="http://test.,,,,,,,,.com">Return to Homepage</a></p>
        </div>

 

 

Share this post


Link to post
Share on other sites

Ok, so it's not passing in the start date. Find out where that's being called from and see if you can trace the call from there. Also, it's a notice error, so you can probably just hide it. Does the thing you're trying to do actually work, though? There's also this...

            <p style="font-size: 16px; color: #001B6B">Unauthorized access - Invalid Permissions.</p>
 

Check the permissions of your files

Share this post


Link to post
Share on other sites

This from the original file StatsData.Class.php  Here is the section w/ Line 171

 

    /**
     * Get all of the months since a certain date
     */
    public static function getMonthsSinceDate($start) {
        
        $key_month = date('MY', $start);   (note this is Line 171)
        $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;
    }

    /**

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×