CRT Parameters in Dashboard (5.4)

Permalink 1 user found helpful
Still some Windows errors on the dashboard when development is selected in "debug mode".

( ! ) Warning: Invalid CRT parameters detected in D:\WWW\Cms Systemen\concrete5.3.3.1\concrete\controllers\dashboard\modules\activity.php on line 14
Call Stack
#   Time   Memory   Function   Location
1   0.0005   661224   {main}( )   ..\index.php:0
2   0.0017   768256   require( 'D:\WWW\Cms Systemen\concrete5.3.3.1\concrete\dispatcher.php' )   ..\index.php:2
3   0.3134   13948640   View->render( )   ..\dispatcher.php:236
4   0.3466   14337880   include( 'D:\WWW\Cms Systemen\concrete5.3.3.1\concrete\single_pages\dashboard\view.php' )   ..\view.php:746
5   0.3472   14337880   DashboardHomepageView->output( )   ..\view.php:7
6   0.3472   14379000   Loader->dashboardModule( )   ..\homepage.php:69
7   0.3472   14379048   Loader->dashboardModuleController( )   ..\loader.php:275
8   0.3483   14425544   ActivityDashboardModuleController->__construct( )   ..\loader.php:267
9   0.3534   14484952   strftime ( )   ..\activity.php:14
( ! ) Warning: Invalid CRT parameters detected in D:\WWW\Cms Systemen\concrete5.3.3.1\concrete\controllers\dashboard\modules\activity.php on line 14
Call Stack
#   Time   Memory   Function   Location

 
Remo replied on at Permalink Reply
Remo
It's a well known problem that the windows crt doesn't support all date formats. I don't remember all the details but I think it usually happens with dates before 1970

Try removing some formats, if you locate the one that causes all the problems with might be able to find an alternative for it.

Can't help you with that though. Only have some customers running on windows server, not possible to update to 5.4
Remo replied on at Permalink Reply
Remo
http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

seems like %l isn't supported.. Can you please verify that?
Remo replied on at Permalink Reply
Remo
sorry for spamming this, but what is %l supposed to do??

http://php.net/manual/de/function.strftime.php...

It might have to be %I (capital i) and not an lower "L"..
shenn replied on at Permalink Reply
Yes Windows needs a capital i for %i

so I changed the code a little bit for the file concrete/controllers/dashboard/modules/activity.php

<?php 
defined('C5_EXECUTE') or die(_("Access Denied."));
class ActivityDashboardModuleController extends Controller {
   public function __construct() {
      Loader::model('user_statistics');
      Loader::model('page_statistics');
      $u = new User();
      $ui = UserInfo::getByID($u->getUserID());
      $us = new UserStatistics($ui);
      $this->set('uLastActivity', $us->getPreviousSessionPageViews());
      if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $time_str = '%x ' . t('at') . ' %I:%M %p';             
      } else {
             $time_str = '%x ' . t('at') . ' %l:%M %p';    
      }


I made an if else statement for PHP_OS === 'WIN' and put the time in a variable.

perhaps it can be implemented in future versions of C5.

*edit*
Look carefully because some fonts give you the same look of an i or an l or an I. hehe