Skip to content

Template gets imported as default #403

@faustbrian

Description

@faustbrian

Bug description

We're in the process of testing a migration to the Eloquent driver due to significant performance issues with the amount we have. The Eloquent driver solves all of them but we noticed that a lot of our pages broke. We ended up tracking this down to the YAML not being imported as an exact copy. The JSON in the entries table has the template property set to default instead of the template that was specified in the original file.

YAML (source)

---
id: 981b4627-bb43-45c9-8f1b-f1f5e7eb40e0
origin: 765073ff-6d00-47a3-9a05-d1082db6acaa
image: null
title: Integrationer
textarea: null
template: integrations/index
sections: {  }
seo_title: 'REDACTED'
seo_description: 'REDACTED'
seo_og_image: images/REDACTEDjpeg
updated_by: 9d57592f-8f28-47fa-9ae5-6844892b1483
updated_at: 1718307225
---

JSON (entries table)


{
  "background_color": "beige",
  "title": "REDACTED",
  "updated_by": "0c542901-8050-419f-be8a-3c472c09a66d",
  "textarea": null,
  "hero_type": "hero_with_image",
  "template": "default",
  "image": null,
  "sections": [],
  "seo_title": "REDACTED",
  "seo_description": "REDACTED",
  "seo_og_image": "images/REDACTED.png",
  "add_column": false,
  "hide_when_authenticated": false,
  "parent": "c0c7f893-37e6-47f1-b404-ec3ee0f5299a",
  "__localized_fields": [
    "image",
    "title",
    "textarea",
    "sections"
  ]
}

How to reproduce

Import entries with custom templates.

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 11.44.1
PHP Version: 8.3.17
Composer Version: 2.8.4
Environment: local
Debug Mode: ENABLED
URL: statamic.test/fi
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Livewire
Livewire: v3.6.1

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.13.0
PHP SDK Version: 4.10.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 5
Sites: 6 (Eesti, Suomi, Suomi (Englanti), and 3 more)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.50.0 PRO

Statamic Addons
aerni/advanced-seo: 2.12.0
marcorieser/statamic-livewire: 4.1.0
mitydigital/sitemapamic: 3.2.0
spatie/statamic-responsive-images: 5.2.2
statamic/eloquent-driver: 4.20.0

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: file
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions