Better Preview

Better Preview Changes Publish Down Date

7 months 2 weeks ago #73185

Tim Rinkel's Avatar Tim Rinkel

Hi Peter,

Just updated to Joomal! 3.7.3. I also updated Regular Labs extensions and I think Better Preview was one of them, but don't hold me to that.

Now, when I click the preview button, if there is a Publish Down date, it is changed today's date with a time of 19:00:00 (00:00:00 in the database). It doesn't seem to change anything if there is not a Publish Down date.

I'm not sure what you need at this point to investigate. You have credentials from my previous post if you need them (and if that works). Let me know if you need anything else.

Thanks!

Tim

7 months 2 weeks ago #73198

Peter van Westen's Avatar Peter van Westen Admin

This is probably down to a change in Joomla with regards to the default nullDate in the database. Are you using MySQL 5.7?
github.com/joomla/joomla-cms/pull/11530

But I have not been able to reproduce this issue on my own setups.
Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Hidden text' button in the forum editor to hide the confidential information.

7 months 2 weeks ago #73202

Tim Rinkel's Avatar Tim Rinkel

MySQL is 5.6.32-78.1-log

I tested the issue on more than on article last night at about 20:00-20:30 US Central time. The down time was changing from "2018-06-03 00:00:00" to the current day but at a time before the current time (19:00 local, 00:00 in the database). I just tried it again and didn't have the problem. Either something fixed itself or I'm going nuts. Maybe the issue occurs after a certain time in the evening, like after 19:00?

This is the article I was having problems with last night:

https://www.rochesterfsc.org/222-contract-skating/member-news/2931-2017-2018-school-year-schedules

This is a test article you can play with
https://www.rochesterfsc.org/194-admin-flotsam/2932-articles-anywhere-playground

Confidential information:
(hidden)


Thanks!

Tim

7 months 2 weeks ago #73207

Peter van Westen's Avatar Peter van Westen Admin

If you are able to reproduce the issue again, let me know...

7 months 2 weeks ago #73246

Tim Rinkel's Avatar Tim Rinkel

I tried to reproduce this several times over the last couple of days and couldn't. This evening I tried it at 19:30 (US Central, which I think comes out 00:00 UTC—or at least that's what shows up in the database) and the issue occurred again.

I also noticed that the Publish Up and Modified dates change as well (without saving the article). I accessed the playground article (link above) at 19:47. The Publish Up Date was 2017-07-01 14:24:00, the Publish Down Date was 2018-08-31 00:00:00 (I also tried it at a time that was not 00:00:00 with the same results) and the Created Date was 2017-07-01 14:24:00.

When I click the Preview button, I get a 404 error in the preview modal. When I close the modal, the three dates have not changed. However, if I refresh the page (the article editor) the Publish Up Date changes to 2017-07-06 19:00:00, the Publish Down Date to 2017-07-08 19:00:00 and the Created Date did not change. Since I had to refresh the page to see the changes, it looks like the changes are made to the database, but the editor window is not updated. After the refresh, the Modified Date is the current date and time.

Also, if I check the page in the front end, before refreshing the editor page, it already acts as if the article is unpublished. If I replace the dates with the original dates and save without clicking the Preview buttons, the original dates are saved correctly.

The issue happens with both the Preview button and selecting the preview link in the menu bar.

. . . and I was really starting to think it was just me B)

Thanks Peter!

Tim

7 months 2 weeks ago #73247

Peter van Westen's Avatar Peter van Westen Admin

Can you track down what error broke the page load of Better Preview in the php error log?

Better Preview needs to change stuff in the database to be able to show unpublished items and the changes these back after the preview is rendered (so within same pageload).

In your case the page breaks for some reason halfway through. So Better Preview doesn't get the chance to set back the changes it had to make...

7 months 2 weeks ago #73248

Tim Rinkel's Avatar Tim Rinkel

What is the best way to do that?

7 months 2 weeks ago #73249

Peter van Westen's Avatar Peter van Westen Admin

Probably you have a php errorlog file in the root of your website. Otherwise ask your host.

7 months 2 weeks ago #73250

Tim Rinkel's Avatar Tim Rinkel

I checked the error_log and didn't find much. If I have the timezone for the log right (server is in Utah, I'm in Minnesota) the error would have occurred around 18:30. There are no log entries for the 18:00 hour.

Here is the error_log that surrounds the time period. Maybe you can see something I can't. I have removed a number of errors from a plugin that has had issues for some time. There is also a date/time error at 19:47 that may actually be from one of my Sourcerer scripts.

Confidential information:
(hidden)


Is there anywhere else I should look?

I can also try it again this evening and watch the log in real time. I tried to reproduce the error just now and of course the error didn't happen and nothing showed up in the log.

Tim

7 months 2 weeks ago #73251

Peter van Westen's Avatar Peter van Westen Admin

If you find out how to reproduce the issue again and again, then I can try to figure out what is causing it.
If and when so, I would also need (s)ftp access...

7 months 2 weeks ago #73252

Tim Rinkel's Avatar Tim Rinkel

It appears to me to be a when rather than how related issue. Both times it has happened after 19:00 local time which I think is 00:00 UTC. 00:00 is what shows up in the database when the error occurs and 19:00 is written to the editor fields, so it would make sense that that is when the error starts, but I don't have proof to that effect. I also don't have a clue as to the stop time. Maybe when it is 00:00 server time?

I will try to pin down something more specific this evening. In the mean time:

Confidential information:
(hidden)


So, I had issues with the FTP account and now it is evening so I tried the issue again. I wasn't able try between 18:00 and 19:00 to try and verify when exactly the issue starts. However, this morning Better Preview was working properly. This evening at 20:04, it wasn't. My best guess is still that it starts at 19:00 (00:00 UTC).

When I tried this evening, I tailed the log as I did it and verified that nothing is written to error_log when the problem occurs.

Tim

7 months 2 weeks ago #73254

Peter van Westen's Avatar Peter van Westen Admin

So for me that is between 02:00 and 07:00 AM :S
So hard for me to debug this.

I have done a little change when checking for publish up/down dates. No idea if this will fix things.

7 months 2 weeks ago #73259

Tim Rinkel's Avatar Tim Rinkel

Yeah, I knew time would be an issue. :P

One note. I noticed that there isn't a Publish Down Date for the article right now. The issue doesn't happen unless there is date there.

I'll try it again tonight and see what happens.

Tim

7 months 5 days ago #73483

Tim Rinkel's Avatar Tim Rinkel

Hi Peter,

Sorry it's been so long, I was out of town for several days.

I've checked the issue on several different days and have not been able to reproduce it since your last post. With hopes that I'm not jinxing it, and with fingers crossed, the issue appears to be resolved. I will keep an eye on it and report back if it returns.

Out of curiosity, what was the "little change" that you made?

Tim

7 months 5 days ago #73485

Peter van Westen's Avatar Peter van Westen Admin

The fix was actually only for null dates. So this shouldn't affect behaviour when the date is filled.
So who knows... :S

7 months 5 days ago #73505

Tim Rinkel's Avatar Tim Rinkel

Hmm. Go figure.

Thanks for your help Peter!

Tim