- Issue created by @joseph.olstad
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 5:24pm 22 February 2023 - 🇨🇦Canada joseph.olstad
For some strange reason the node can return a time of 9600-02-22 which in unformated $time value is 240784073640.
In this case, use the value of time() instead - Status changed to Postponed: needs info
over 1 year ago 6:01pm 21 March 2023 - 🇨🇦Canada smulvih2 Canada 🍁
@joseph, I think the only way that
$time
is empty is if your entity is not aninstanceof NodeInterface
. Can you verify what$node
contains when this happens? Or maybe if you are creating the said node programmatically or via migration that the changed date is not being set correctly. - 🇨🇦Canada joseph.olstad
@smulvih2 , the date modified needs to work on all pages, not just node pages. With that said, the patch is harmless and did fix someones severaly hosed environment.
I haven't observied this issue but I saw it first hand in another groups project.
- 🇨🇦Canada smulvih2 Canada 🍁
@joseph I agree the date modified needs to work across all pages, not just nodes, but the description of the ticket mentions it happens "for some nodes" which is why I figured the nodes in question might be the issue. I'm not sure what would cause this, but the date modified block works for me across node and non-node pages, on all sites I manage. If you are able to provide steps to reproduce that would be very helpful!
For non-node pages, the
$time = $this->dateTime->getRequestTime();
line should grab the current time. It is only when the current page is a node that it grabs the time from the node in question. This is what leads me to believe the nodes have an issue with them. - 🇨🇦Canada nancyHebert
I created a new patch the item in $value for the date modified is already a unix timestamp and it was the correct timestamp (i.e) 1645488000), using strtotime on it changed it to be 190296492348 i.e year 8000.
I added a function to check if the timestamp was a valid gregorian date as well. - Status changed to Closed: outdated
over 1 year ago 1:13pm 26 July 2023