question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Page template dropdown disappeared after upgrading to Acorn v3.x

See original GitHub issue

Terms

Description

What’s wrong?

After upgrading Acorn to the 3.0.0-alpha.3 version (but it also happens on alpha.1 & alpha.2), the Template dropdown in the Page attributes metabox has completely disappeared somehow. When viewing my template sin the frontend I get a Target class [sage.view] does not exist. error?

What have you tried?

  • I tried installing all 3.0.0-alpha versions and running all of these commands afterwards:
wp acorn acorn:init
wp acorn package:discover
wp acorn vendor:publish
wp acorn config:clear
wp acorn optimize:clear
wp acorn optimize
wp acorn view:cache

All without errors and I can also see my log1x/acf-composer fields & log1x/poet types in the backend.

  • I disabled all of my plugins.
  • I disabled all of my wordpress actions/filters in my theme.

What insights have you gained?

I think Acorn possible is not recognising my template files inside the resources/views folder even though get_theme_file_path('/resources/views') is returning the correct path?

Possible solutions

Downgrading to Acorn 2.1, but then I’m bumping into this bug again.

Temporary workarounds

Switch to a default Wordpress theme

Steps To Reproduce

  1. Install roots/acorn 3.0.0-alpha.3 with composer in your Bedrock folder: composer require roots/acorn:3.0.0-alpha.3
  2. Call the bootloader in your functions.php: \Roots\bootloader()->boot();
  3. Go to an edit page in your Wordpress backend and have a look at the Page attributes box in the right sidebar.
  4. Switch to a default Wordpress theme and repeat step 3.

Expected Behavior

The Page attributes box in the right sidebar should have a Template dropdown.

Actual Behavior

The Page attributes box in the right sidebar does not have a Template dropdown anymore.

Relevant Log Output

No php errors whatsoever

Versions

Acorn 3.0.0-alpha.3 PHP 8.0.22 Composer version 2.4.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fellycommented, Oct 25, 2022

I had the same Target class [sage.view] does not exist. error. I forgot to call the parent’s register()/boot() methods.

Here is my working ThemeServiceProvider:

<?php

namespace App\Providers;

use Roots\Acorn\Sage\SageServiceProvider;

class ThemeServiceProvider extends SageServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        parent::register();
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();
    }
}
0reactions
Twansparantcommented, Aug 31, 2022

Did you notice it moved from page attributes to it’s own separate template panel?

Yeah I did notice that, but only if you have enabled Gutenberg, which I haven’t for this theme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page templates missing from page attributes after 5.8
Hi,. Since the upgrade to 5.8, I've noticed templates are missing from page attributes on several websites I manage. It's only the select...
Read more >
Template Dropdown not showing up within Wordpress ...
I was creating a new page that will use my new template, when suddenly, the "Template" dropdown in the "Page Attributes" box is...
Read more >
Can't choose page template because button is gone. Update ...
Having an issue that seems like a bug. Just updated my homepage and it reset the template to default. The button to choose...
Read more >
Page Template Dropdown Missing from Page Attributes
Has anyone figured out how to get the “page templates” dropdown back in the “Page Attributes” area? ... It is some sort of...
Read more >
Page template option missing - WordPress Stack Exchange
The page was set as the posts page in settings > reading , which prevents from chosing a specific page template since this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found