Horizon updates cause newer pages to change template?

Hi, all. Hoping someone might be able to help me. I’m using the Horizon theme and love it. Just one problem. The past two updates have caused newer page templates (and assigned pages) to revert to using a default page template, and I can’t figure out what I might be doing wrong to cause this, or if it’s a bug.

All old pages update just fine. It’s only newer pages (made since last update) that get booted off the new page template that was created for that page.

Notes: each new page does indeed have its own page in “content/pages” as well as its own page template in the theme editor. Each template has a “page” section (though I’ve hidden it on some, but that doesn’t seem to matter on the older pages where I’ve done the same).

Basically, for example, I created a new “podcast” page a couple of days before updating to Horizon 4.1.3. It is in the content section and it has its own template in the theme editor. When I updated to 4.1.3 yesterday, all older pages updated successfully but the new podcast page somehow got put on the default page template, even though it still shows that its assigned to “podcast” page template.

I was able to revert back to Horizon 4.1.1 and get my podcast page and template back.

Anyone know what might be going on here? I actually lost two other pages in a previous update for the same reasons but at that point I had no idea and just deleted them, thinking it was a fluke and I’d have to rebuild them. This is the second time it’s happened, so not just a fluke. Any help is greatly appreciated. TIA.

Hi @anon26642340

Could you please send me the page URL and a screenshot from your Shopify admin showing the page template assignment ? I’ll check it and get back to you with a proper update on what might be causing the issue.

Best regards,
Devcoder :laptop:

This isn’t you doing anything wrong, and it’s not really random. It’s how theme updates interact with your custom page templates.

When you make a new page template in the editor (your “podcast” one), Shopify saves it as a JSON file in the theme, something like templates/page.podcast.json. A Horizon update replaces the theme’s files with the new version’s files. Any template JSON that shipped with the previous version survives the merge, but a custom template you added since your last update isn’t part of what the updater is merging from, so it can get dropped or reset. Once that JSON file is gone, the page has nothing to point at, so Shopify falls the page back to the default page.json template. That’s exactly the pattern you’re seeing: old pages fine, only pages created since the last update get booted.

A couple of things worth checking to confirm that’s what’s happening:

  1. On 4.1.3 (the version that breaks it), go to the code editor and look under templates/ for page.podcast.json. My guess is it’s missing or has been reset to a default body. If it’s gone, that confirms the update dropped it, and the Admin assignment reverting to default is a symptom, not the cause.

  2. Before you update again, duplicate your live theme first (Themes, … menu, Duplicate). That gives you a rollback that keeps your current template files, since the version history in the code editor doesn’t restore JSON files.

For an actual fix rather than staying on 4.1.1:

  • Duplicate the theme as a backup.

- Copy the raw contents of each custom page template JSON (page.podcast.json and any others) out into a text file, so you have the section setup saved outside the theme.

- Update to 4.1.3 on the duplicate.

- If the custom templates are gone after the update, recreate them in the code editor by pasting your saved JSON back into templates/page.[name].json, then reassign each page to its template in the page’s Admin settings.

It’s tedious but it survives future updates better than editing the default template, because the update only touches files it recognizes.

Since this is reproducible across two updates and it’s specifically new templates, it’s worth Shopify seeing it as a possible Horizon updater bug, not just a support case. If you still have the two admin screenshots, the before/after of the same page’s template assignment is exactly what they’d need.

Thank you so much! I really appreciate your assistance, and I will be sure to do this in the future before updating, just in case.

Glad it worked for you :+1: