eloquent-driver
eloquent-driver copied to clipboard
origin_id in localized entries are causing error
I was trying to import 8804 entries from a current page with php please eloquent:import-entries.
It stopped with:
Call to a member function id() on string
at vendor/statamic/eloquent-driver/src/Entries/Entry.php:46
42▕ }
43▕
44▕ return $class::findOrNew($this->id())->fill([
45▕ 'id' => $this->id(),
➜ 46▕ 'origin_id' => $this->origin()?->id(),
47▕ 'site' => $this->locale(),
48▕ 'slug' => $this->slug(),
49▕ 'uri' => $this->uri(),
50▕ 'date' => $this->hasDate() ? $this->date() : null,
When I removed the translated data folders (with about 587 entries), it finishes without any problems. Any ideas?
Statamic 3.3.43 Pro Laravel 8.83.25 PHP 8.0.16 statamic/collaboration 0.4.0 statamic/eloquent-driver 1.0.1
Interesting one - at a guess I'd say its because its inserting the translation before the origin. Would there be any chance of giving me access to the data so I can try and come up with a work around? I've unfortunately not got access to a site with so many translated entries to work against.
You're completely right! I just readded them and it finished importing without any problems.
Great - that’s good to know. I’ll refactor the import to run those without an origin first.