Page 1 of 2

Errors Reported When Editing Post Going To Preview

PostPosted: Fri Mar 02, 2012 1:23 am
by Kimberly
I went to edit a post, no problem there. However, when I go to preview the post before committing my edits I receive the following at the top of the preview. Note: my changes are shown in the preview. I am concern about committing the changes so until this is resolved or understood why then I won't be able to edit any posts. I think this might be the first time I have edited a post since moving to QP. I had no problem creating a post and going to the preview.

Code: Select all
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
After 10 Years, Mum's 1983 Buick LeSabre Comes To Life

By Kimberly
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
on Dec 31, 1969 | In Everyday Thoughts
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
| Send feedback »
Invalid post, please correct these errors:
Please enter a valid issue date.


I have not made any changes to the php file listed by the error.

Edit Notice the date listed, on Dec 31, 1969. That is odd. The post itself is showing 2012-02-29 as the creation date.

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Fri Mar 02, 2012 1:25 am
by Kimberly
I created the post without any problems and preview functioned as it should at that time.

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Fri Mar 02, 2012 1:40 am
by Kimberly
Here is a kick in the arse, I went into the database and added what I needed and it doesn't show up. So what in hell is with that? Doesn't QP pull the post contents from the Post Contents table?

Update, I hit the edit button and lo and behold the changes I made directly to the database show up. I hit refresh several times.

OK, I went to two different browser other than my main. So, I guess it is time to educate Kimberly on how the freaking database works. Why is it that if I go to edit, I can see what I added to the database directly, but it doesn't show up when I view the freaking blog?

I went ahead and added the photo I wanted and hit save and it did not seem to screw up the post. Now, what the heck is going on with the preview?

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Sun Mar 04, 2012 7:38 pm
by leeturner
Did you clear the cache ?

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Sun Mar 04, 2012 10:32 pm
by Kimberly
leeturner wrote:Did you clear the cache ?


Several times. I need to check and see if this shows up on some of the past posts I have made. I also need to install a new QP test bed for cross checking.

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Fri Apr 20, 2012 7:44 pm
by Kimberly
Today when working on a saved draft of an article, the preview error appeared. I need to start documenting this so I can have some idea why it happens I am thinking it is occurring with posts that have been saved; either published or drafts. The post published without problems. It could be my .htaccess file again. I had permission problems with the file manager due to my .htaccess entries. However, I would think that would happen with all previews.


Code: Select all
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
Hostess Ho Hos - Is it the end?

By Kimberly
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
on Dec 31, 1969 | In Everyday Thoughts
Warning: mktime() expects parameter 4 to be long, string given in /weblog/blogs/qp_inc/_core/_misc.funcs.php on line 859
| Send feedback »
Invalid post, please correct these errors:
Please enter a valid issue date.


The next time I encounter this error I will disable my .htaccess file and see if that is causing this.

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Fri Apr 20, 2012 10:02 pm
by leeturner
This doesn't sound like a .htaccess problem but something to do with php version and the mktime() function.

Just out of interest, what version of PHP are you running ?

Cheers
L

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Sat Apr 21, 2012 11:26 am
by EdB
I just bumped into and got passed the same error when doing ... ah heck I don't even remember what. Oh yeah: doing a plugin that stores dates in mysql format. mktime() expects 6 integers as parameters for the hh:mm:ss yy:mm:dd or maybe (yyyy). QP pulls the info from a database, which is of course a string, then plucks out the integer values. Since a date is stored as YYYY-MM-DD HH:MM:SS it is not so hard to find which 4 characters are the year eh?

So why did it choke on the year? I am not storing time of day, so it extracted all zeros for those first three, but apparently could not extract something that seemed like an integer for the 4th parameter.

So I put a pre_dump( bits... );die(); inside our function that uses mktime() and saw that my code was correct. I then tweaked the plugin to do EXACTLY what core was doing and it worked. I then let core do it again and it failed, but then worked and hasn't failed since.

Of note in my case is that WAMP died when I uninstalled stupid logitech webcam software. Uninstalling that really messed up my poor old computer, most notably is that WAMP completely died. So I had to reinstall WAMP but can not switch it to an older version of MySQL or Apache or PHP or phpmyadmin. Therefore my home computer is stuck on php 5.4.something.

So ... what version of php are you dealing with?

Off topic Sometimes I think we need a "floating hook" that lets us email ourselves bits whenever we need it. Call it DeepTroubleShooting() and have a plugin that emails params fed to it. So in this case right inside the function that calls mktime() you could send the plugin the contents that the mysql date formatting function got and have that info emailed. The plugin would probably have to process the data to make it email-friendly, and we would do a hook so that a different plugin could store it in a database table or whatever.

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Sat Apr 21, 2012 12:52 pm
by leeturner
I have never come across this problem on my sites when previewing posts or anything else for that matter. On my live sites my host is running php 5.2.17 and mysql 5.1.56. On my local MAMP install it is running php 5.3.6 and mysql 5.5.9

L

Re: Errors Reported When Editing Post Going To Preview

PostPosted: Sat Apr 21, 2012 9:25 pm
by Kimberly
PHP Version 5.2.17

I have so far only seen this error twice. Once was editing an old post and I got the above errors when previewing; which made me nervous about editing the post. However, no problem saving the file back out; only shows up on the previewing. The other was just recently when I returned to a draft post and finished it; running the preview gave the errors.