You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #65, except this time for Statamic\Taxonomies\LocalizedTerm.
Bit more difficult to solve this time, as there is no Statamic\Contracts\Taxonomies\LocalizedTerm to create a new binding for.
The lastModified() method in LocalizedTerm is checking for updated_at as a timestamp, but in Eloquent, the updated_at is a Carbon instance. So what is happening is the string version of the Carbon instance is being parsed into a timestamp, which results in approximately 2100 seconds (Carbon adds the integer values of each part of the date string for some reason, e.g. 2025-03-12 10:50:35 results in 2025 + 3 + 12 + 10 + 50 + 35 = 2135 or 2135 seconds past the Unix epoch).
How to reproduce
useStatamic\Eloquent\Taxonomies\Taxonomy;
useStatamic\Facades\TermasTermFacade;
useStatamic\Taxonomies\LocalizedTerm;
Taxonomy::make('test')->title('test')->save();
tap(TermFacade::make('test-term')->taxonomy('test')->data([]))->save();
/** @var LocalizedTerm $term */$term = TermFacade::query()->first();
$term->set('foo', 'bar');
$term->save();
$term->updated_at->toDateTimeString();
// example output: 1970-01-01 00:35:26// note that actual time will depend on when the command is run
Bug description
Similar to #65, except this time for
Statamic\Taxonomies\LocalizedTerm
.Bit more difficult to solve this time, as there is no
Statamic\Contracts\Taxonomies\LocalizedTerm
to create a new binding for.The
lastModified()
method inLocalizedTerm
is checking forupdated_at
as a timestamp, but in Eloquent, theupdated_at
is a Carbon instance. So what is happening is the string version of the Carbon instance is being parsed into a timestamp, which results in approximately 2100 seconds (Carbon adds the integer values of each part of the date string for some reason, e.g.2025-03-12 10:50:35
results in2025 + 3 + 12 + 10 + 50 + 35 = 2135
or 2135 seconds past the Unix epoch).How to reproduce
or as a test:
Logs
Environment
Can be reproduced on a fresh clone of https://github.com/statamic/eloquent-driver
Additional details
No response
The text was updated successfully, but these errors were encountered: