Pro-GSG / gantry-framework

Automatically exported from code.google.com/p/gantry-framework
0 stars 0 forks source link

Warning: Invalid CRT parameters detected in C:\wamp\www\joomla\libraries\gantry\core\utilities\gantrydate.class.php on line 242 #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Install Gantry framework
2.Install Gantry template
3.Activate the template as default

What is the expected output? What do you see instead?
A warning: Warning: Invalid CRT parameters detected in 
C:\wamp\www\joomla\libraries\gantry\core\utilities\gantrydate.class.php on line 
242

What version of the product are you using? On what operating system?
Window 7, Joomla 1.6, newest version of wamp server, newest version of Gantry 
(27 hours ago).

Please provide any additional information below.
I have provided a picture

Original issue reported on code.google.com by Skou.r...@gmail.com on 19 Feb 2011 at 8:13

Attachments:

GoogleCodeExporter commented 8 years ago
are you running PHP 5.3 ? seems to be a specific bug with wamp and php 5.3.  
http://pampserver.com/forum/read.php?5,1001

Original comment by a...@rockettheme.com on 1 Mar 2011 at 6:16

GoogleCodeExporter commented 8 years ago
I receive the same error with the last release of EasyPHP.

Original comment by sardelli...@gmail.com on 27 Apr 2011 at 9:27

GoogleCodeExporter commented 8 years ago
This is due to CRT values used which are not compatible with Windows. To 
resolve this issue, add the following code to 
libraries\gantry\core\utilities\gantrydate.class.php on line 242:

If ($_SERVER["OS"] == "Windows_NT") {
    $format = str_replace("%h", "%b", $format);
    $format = str_replace("%e", "%#d", $format);
}

Original comment by yout...@sanexeh.nl on 18 May 2011 at 9:31

GoogleCodeExporter commented 8 years ago
The code that you have provided is not working

I am using Joomla 1.6.3 with the latest gantry framework on 
Windows 7 (64bit version) and Wamp server.

Please help.

Thanks

Original comment by 2Ash....@gmail.com on 24 May 2011 at 6:39

GoogleCodeExporter commented 8 years ago
hi

i have the exact same problem and it's driving me crazy. i've already installed 
severall versions of wamp and php. nothing works.

if you'll find a solution please let me know, and i'll do the same

thanks
alek

Original comment by alekmas...@gmail.com on 25 May 2011 at 12:14

GoogleCodeExporter commented 8 years ago
if you know that you are using a windows machine to host your joomla 
installation, the if statement is not necessary, though, props to the solution 
presented, it is robust ...

the only code you need is (i have attached the modified version as well):

    $format = str_replace("%h", "%b", $format);
    $format = str_replace("%e", "%#d", $format);

    $date = strftime($format, $time);

Original comment by robir...@gmail.com on 3 Jun 2011 at 5:35

Attachments:

GoogleCodeExporter commented 8 years ago
I added the following instead:

if(PHP_OS == 'WINNT'){
    $format = str_replace("%h", "%b", $format);
    $format = str_replace("%e", "%#d", $format);
}

Original comment by dukeofga...@gmail.com on 29 Jun 2011 at 12:03

GoogleCodeExporter commented 8 years ago
hi,
the same problem in KFM FILEMenager, Win7, PHP 5.3.

solution:
in initialise.php find:

$kfm->defaultSetting('time_format', '%T');

and change to:

$kfm->defaultSetting('time_format', '%X');

Original comment by dzari...@gmail.com on 29 Jun 2011 at 3:33

GoogleCodeExporter commented 8 years ago
hi,

i also have this issue. please help me to resolve this.
im using windows 7 64bit, wamp newer version, joomla 1.5.23 and gantry 3.1.15
i also attach my error window screen shot

Original comment by yashila...@gmail.com on 20 Jul 2011 at 10:53

Attachments:

GoogleCodeExporter commented 8 years ago
hi,

and i haven't libraries\gantry\core\utilities\gantrydate.class.php dir

this is my dir url

wamp\www\gantry\libraries\joomla\utilities\date.php on line 250

Original comment by yashila...@gmail.com on 20 Jul 2011 at 10:56

GoogleCodeExporter commented 8 years ago
This fix does not work if you set the date format as

Sunday 7 August 2011

Original comment by freshbl...@gmail.com on 7 Aug 2011 at 9:35

GoogleCodeExporter commented 8 years ago
Gantry v3.2.8
php 5.3.4
w7 64bit

This works for me

/**
     * Translates needed strings in for JDate::toFormat (see {@link PHP_MANUAL#strftime})
     *
     * @access protected
     * @param string $format The date format specification string (see {@link PHP_MANUAL#strftime})
     * @param int $time Unix timestamp
     * @return string a date in the specified format
     */
    function _strftime($format, $time)
    {
        if(strpos($format, '%a') !== false)
            $format = str_replace('%a', $this->_dayToString(date('w', $time), true), $format);
        if(strpos($format, '%A') !== false)
            $format = str_replace('%A', $this->_dayToString(date('w', $time)), $format);
        if(strpos($format, '%b') !== false)
            $format = str_replace('%b', $this->_monthToString(date('n', $time), true), $format);
        if(strpos($format, '%B') !== false)
            $format = str_replace('%B', $this->_monthToString(date('n', $time)), $format);
            // henok was here 
        if(PHP_OS == 'WINNT'){
            $format = str_replace("%h", "%b", $format);
            $format = str_replace("%e", "%#d", $format);}
        $date = strftime($format, $time);
        return $date;
    }

Original comment by 443...@gmail.com on 10 Aug 2011 at 8:07

GoogleCodeExporter commented 8 years ago
Thanks after c hanging from Wamp to Xampp and using the code in post 12, it 
solved the problem for me.

Original comment by mackenzi...@gmail.com on 21 Sep 2011 at 10:40

GoogleCodeExporter commented 8 years ago
THen I updated Gantry- Message came Back - But not to worry, I replaced the 
code again and now it works again.

Original comment by mackenzi...@gmail.com on 21 Sep 2011 at 11:38

GoogleCodeExporter commented 8 years ago
@ dukeofga...@gmail.com

Your code worked for me.

My configuration:
Win7 x64 (localhost)
XAMPP 1.7.7 (MySQL 5.5.16 - Apache 2.2.21 - PHP 5.3.8)
Joomla! 1.7.1
Gantry: gantry_framework_joomla16-3.2.11 - rt_gantry_j16-3.2.11

Original comment by dubl...@gmail.com on 2 Oct 2011 at 6:42

Attachments:

GoogleCodeExporter commented 8 years ago
I had the same error and, now it´s O.K.
Thanks a lot!!!!!!!!!

Original comment by arturo.f...@gmail.com on 7 Nov 2011 at 4:48

GoogleCodeExporter commented 8 years ago
Up to now this works fine for me too:

if(PHP_OS == 'WINNT'){
    $format = str_replace("%h", "%b", $format);
    $format = str_replace("%e", "%#d", $format);
}

Using win7 with wamp !
File attached too !

Original comment by axxofo...@gmail.com on 14 Nov 2011 at 12:53

Attachments:

GoogleCodeExporter commented 8 years ago
TY! added at line 242 before: $date = strftime($format, $time);
works fine

Original comment by olo...@gmail.com on 16 Nov 2011 at 3:39

GoogleCodeExporter commented 8 years ago
Thank you guys! It's work on my Windows7 + xampp 1.7.7

Original comment by arhipov....@gmail.com on 17 Nov 2011 at 2:30

GoogleCodeExporter commented 8 years ago
Thanks alot :)

Original comment by feroze.a...@gmail.com on 19 Nov 2011 at 6:19

GoogleCodeExporter commented 8 years ago
@dukeofga...@gmail.com
Thank you, it works!

Original comment by Noga...@gmail.com on 21 Nov 2011 at 1:17

GoogleCodeExporter commented 8 years ago
The "Comment 12 by 443...@gmail.com, Aug 10, 2011" worked perfectly. File to be 
modified: \libraries\joomla\utilities\date.php. Replace the existing _strftime 
function with the one in the comments.

Original comment by leeantho...@gmail.com on 21 Nov 2011 at 9:33

GoogleCodeExporter commented 8 years ago
Comment 12 and Comment 22 works for me!!

My details:
Windows Xp
WampServer Version 2.2 
Gantry j15
Joomla 1.5.23

Original comment by humbert...@gmail.com on 23 Dec 2011 at 5:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I was able to fix the problem as well. 
gantry\libraries\joomla\utilities\date.php
I added the line below as denoted in the function _strftime($format, $time)
See comment 12 by 443

if(PHP_OS == 'WINNT'){
            $format = str_replace("%h", "%b", $format);
            $format = str_replace("%e", "%#d", $format);}

Original comment by gothic.r...@gmail.com on 3 Apr 2012 at 4:39

GoogleCodeExporter commented 8 years ago
Thx for this comment:
Comment 6 by robir...@gmail.com, Jun 2, 2011
if you know that you are using a windows machine to host your joomla 
installation, the if statement is not necessary, though, props to the solution 
presented, it is robust ...

the only code you need is (i have attached the modified version as well):

    $format = str_replace("%h", "%b", $format);
    $format = str_replace("%e", "%#d", $format);

    $date = strftime($format, $time);
    gantrydate.class.php 
8.7 KB   View   Download

I just replaced this code on mine and its work! Thx See here the link for 
download: 
http://code.google.com/p/gantry-framework/issues/attachmentText?id=16&aid=160006
000&name=gantrydate.class.php&token=2r5xSF9M2n36SZ_Gwv8WiXHuoY8%3A1336484357732

Original comment by cont...@agendadasboates.com on 8 May 2012 at 2:30