-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
The TracksLastModified trait has the function :
public function lastModified()
{
return $this->has('updated_at')
? Carbon::createFromTimestamp($this->get('updated_at'))
: $this->fileLastModified();
}
It expects the updated_at to be a timestamp, but the Eloquent driver set a Carbon object.
We use this patch :
diff --git a/src/Entries/Entry.php b/src/Entries/Entry.php
index 3344c2e..42e732c 100644
--- a/src/Entries/Entry.php
+++ b/src/Entries/Entry.php
@@ -25,7 +25,9 @@ class Entry extends FileEntry
->model($model);
if (config('statamic.system.track_last_update')) {
- $entry->set('updated_at', $model->updated_at ?? $model->created_at);
+ if ($updated_at = $model->updated_at ?? $model->created_at) {
+ $entry->set('updated_at', $updated_at->timestamp);
+ }
}
return $entry;
steffen25 and stremehard
Metadata
Metadata
Assignees
Labels
No labels