Subject: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 24/09/08 10:15am
By: zeb

Hi!

When I try to set an article to be deleted or archived automatically I get a really nice error telling me that Windows does not support negative values..., and then the whole geeklog shows this message (well not the admin interface) so what I have to do then is to edit the database table for stories and delete that post and then GL is working agian. I also get the same problem when I´m using the function for articles not to be published directly, later on so to speak.

From the beginning I only got the "normal error" telling me: "Unfortunately, an error has occurred rendering this page. Please try again later" but after chaning to ROOT debug I could se the message here down under.

I use:
* Geeklog 1.5.1rc1
* Windows Server 2003
* MySQL server 5.0
* PHP 4.x
* IIS

ERROR MESSAGE:
---------------------------- Snipp ---------------------------------

An error has occurred:
(This text is only displayed to users in the group 'Root'
2 - mktime() [function.mktime]: Windows does not support negative values for this function @ c:\inetpub\wwwroot\lib-common.php line 6045

array(6) {
["date"]=>
string(10) "1222086772"
["time"]=>
NULL
["atoks"]=>
array(3) {
[0]=>
string(10) "1222086772"
[1]=>
int(0)
[2]=>
int(0)
}
["btoks"]=>
array(0) {
}
["atok"]=>
bool(false)
["i"]=>
int(3)
}
------------------------------------ Snapp -------------------------------

The paramaters in the file "configuration.php"
- Language: Swedish
- Locale: en_GB

Everything els is "Geeklog default" so to speak.

Any good idea´s?

Regards,
Zeb

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 24/09/08 04:18pm
By: Dirk

Quote by: zeb

- Language: Swedish
- Locale: en_GB


Won't help with the actual problem, but you probably want to change the Locale to Swedish_Sweden.

I'm not on Windows so can't reproduce the problem, but I'll ask someone to look into it.

bye, Dirk

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 24/09/08 05:43pm
By: zeb

Hi Dirk,

That would be great, it´s really frustrating this. I´ve been using Mambo and Joomla earlier on and theese cms have always been working good, almost "right out the box" but with GL I´ve been experiencing a lot of problems. Frown

Thnx!

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 24/09/08 09:56pm
By: Laugh

I just tried auto delete and auto archive of stories and didn't have any problems. Specs are similar to your except geeklog 1.5.1 and PHP 5

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 25/09/08 01:06pm
By: THEMike

I can't recreate this either...

Can you give me the content of the gl_stories entry for a story that breaks your site and the exact version of php you are running?

Have you made changes to the date format variables at all?

Thanks,

Mike

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 25/09/08 01:17pm
By: THEMike

Ah I think I've found a fix.

Open system/classes/story.php find (at line 1455 to 1464 in function DisplayElements):

PHP Formatted Code

        case 'expire':
            if (empty($this->_expire)) {
                $return = time();
            } else {
                // Need to convert text date/time to a timestamp
                $return = explode(' ', $this->_expire);
                $return = COM_convertDate2Timestamp($return[0], $return[1]);
            }

            break;
 


Replace with:

PHP Formatted Code

        case 'expire':
            if (empty($this->_expire)) {
                $return = time();
            } else {
                $return = $this->_expire;
            }

            break;
 


It looks like there is a bug technically, but, it doesn't bother PHP5 installs, which happen to work correctly despite the fact that DisplayElements returns false for expiry date instead of the actual expiry date. But it crashes PHP4.

If you can confirm this works, I'll book the fix in.

Mike

Re: Huge problem when using function "auto delete" or "auto archive" articles on WIndows/IIS!

Posted on: 28/09/08 05:01am
By: zeb

Hello!

I did the changes in the story.php file (system/classes/story.php find (at line 1455 to 1464 in function DisplayElements) and it really did the work!

Thanks Mike, I would never ever fix that kind of problem on my own! And thanks everybody else for your help! :-)

Zeb

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=84573