WordPress / twentytwentytwo

Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.
405 stars 92 forks source link

Questions and feedback: Downloading and installing the theme. #270

Closed paaljoachim closed 2 years ago

paaljoachim commented 3 years ago

I made a new local site with Desktop Server to test out WP 5.9.

I downloaded Twenty Twenty Two version 0.4.0 from: https://github.com/WordPress/twentytwentytwo/releases/ (Please add the link directly to the readme.)

I see this:

Screenshot 2021-12-02 at 11 28 15

I click "Live Preview" to check out the site in the Customizer.

Screenshot 2021-12-02 at 11 34 34

The above feels a bit strange. One is able to click the Live Preview link, make modifications, but one is not able to activate the theme.

I clicked X to exit. Went back to the Themes page. Activated Twenty Twenty Two. Noticed this message:

Screenshot 2021-12-02 at 11 40 14

Clicked the back arrow.

Went to install and activate the Gutenberg plugin. (12.0.1)

Went back to activate the theme. Theme activated. I clicked Live Preview. The Customizer opened and I saw this:

Screenshot 2021-12-02 at 11 43 12

The Appearance menu shows this:

Screenshot 2021-12-02 at 11 44 55

I deactivate the Gutenberg plugin.

View the frontend. See a blank screen. I open the Chrome tools to see if I notice any error, but nothing is showing up here.

Screenshot 2021-12-02 at 11 51 34

Going to Appearance -> Editor screen I see this: (There are also errors in Chrome console)

Screenshot 2021-12-02 at 12 01 07

GET https://5-9.dev.cc/wp-json/wp/v2/templates/twentytwentytwo-0.4.0//home?context=edit&_locale=user 404 (Not Found)

Uncaught (in promise) TypeError: Cannot destructure property 'id' of '(intermediate value)' as it is null. at Ke (index.min.js?ver=a8059c1a29b45793bbdfc1b5f0e8932f:15) at Ke.next () at Ze (index.min.js?ver=a8059c1a29b45793bbdfc1b5f0e8932f:15) at Ze.next () at index.min.js?ver=4fef26db4a0ead06ae75996d4e680a4e:1

I assume the blank screen has something to do with the cache.

I checked another site where I also have Twenty Twenty Two activated, and it seems to now finally be coming up correctly.

That was a pretty bumpy experience.

letasync commented 3 years ago

It happened with me also but then I downloaded a fresh copy of TT2 Trunk and replaced with the default theme that was available with 5.9 install. It looks normal now. I really liked the shift of Template parts and template under editor screen side menu.

I am using a development version (5.9-beta1-52296)

tt2 testss1

paaljoachim commented 3 years ago

I went ahead and installed the Beta tester plugin and installed WP 5.9 Beta 1. I had two instances of Twenty Twenty Two, and installed the one that did not say trunk. I am now able to enter the Site Editor.

I will just leave the issue open for now.

jffng commented 3 years ago

Thanks @paaljoachim for the detailed report. Bumpy indeed.

The above feels a bit strange. One is able to click the Live Preview link, make modifications, but one is not able to activate the theme.

So the issue is — manually installing TT2 when 5.9 or Gutenberg is not activated, then clicking "Live Preview" will result in a blank screen. This isn't great UX, but I don't think this is an issue with the theme.

I do wonder if we should bump the Requires at least to 5.9 now that the Beta is live (cc @kjellr if you have thoughts about this). That won't solve this flow though; I think you can still manually upload a theme whose required version is greater than the currently installed one and be presented with the "Live Preview" link.

Theme activated. I clicked Live Preview. The Customizer opened and I saw this:

What is your expectation for what should happen here? There are two related issues being tracked and worked on in Core: https://core.trac.wordpress.org/ticket/54460 https://core.trac.wordpress.org/ticket/54549

GET https://5-9.dev.cc/wp-json/wp/v2/templates/twentytwentytwo-0.4.0//home?context=edit&_locale=user 404 (Not Found) Uncaught (in promise) TypeError: Cannot destructure property 'id' of '(intermediate value)' as it is null.

I was able to replicate this, and am continuing to look into it. The endpoint looks wrong, it shouldn't have the -0.4.0/ appended to it so maybe we need to package and release the theme differently.

kjellr commented 3 years ago

So the issue is — manually installing TT2 when 5.9 or Gutenberg is not activated, then clicking "Live Preview" will result in a blank screen.

Yeah, I think this is covered by https://core.trac.wordpress.org/ticket/54460. But cc-ing @jameskoster just to be totally sure.

I do wonder if we should bump the Requires at least to 5.9 now that the Beta is live (cc @kjellr if you have thoughts about this).

I don't believe that actually prevents folks from installing this on prior versions (but I haven't checked). If folks can still test this on 5.8+ with Gutenberg, then that's fine to do. But we should confirm first. 😄

paaljoachim commented 3 years ago

Btw the above experience was done with WP 5.8.2. Redoing some of it below here.

I downloaded the theme from here: https://github.com/WordPress/twentytwentytwo/releases/ Uploaded and installed it to a site running WP 5.8.2. Updated Gutenberg to 12.0.1.

WP 5.8.2 Appearance submenu looks like this: Screenshot 2021-12-03 at 17 35 53

Going to Appearance -> Editor -> Leads to the blank screen.

Screenshot 2021-12-03 at 17 39 12

This time there are 3 errors

Uncaught TypeError: Cannot read properties of undefined (reading 'model')  blocks.build.js:1 
    at Object.<anonymous> (blocks.build.js:1)
    at t (blocks.build.js:1)
    at Object.<anonymous> (blocks.build.js:1)
    at t (blocks.build.js:1)
    at blocks.build.js:1
    at blocks.build.js:1

Failed to load resource: the server responded with a status of 404 (Not Found)     
/wp-json/wp/v2/templates/twentytwentytwo-0.4.0//page?context=edit&_locale=user:1 

Uncaught (in promise) TypeError: Cannot destructure property 'id' of '(intermediate value)' as it is null
index.min.js?ver=a8059c1a29b45793bbdfc1b5f0e8932f:15 
    at Ke (index.min.js?ver=a8059c1a29b45793bbdfc1b5f0e8932f:15)
    at Ke.next (<anonymous>)
    at Ze (index.min.js?ver=a8059c1a29b45793bbdfc1b5f0e8932f:15)
    at Ze.next (<anonymous>)
    at index.min.js?ver=4fef26db4a0ead06ae75996d4e680a4e:1

Bottom line is that Twenty Twenty Two can not be run with WP 5.8.2 and I assume anything below that as well. Perhaps there can be a check of WordPress version to see that WP 5.9 is higher is running, and if not a notification shows up saying that the theme can only be run on WordPress version 5.9 or higher.

hellofromtonya commented 3 years ago

Yeah, I think this is covered by https://core.trac.wordpress.org/ticket/54460. But cc-ing @jameskoster just to be totally sure.

@kjellr Yes, I can confirm that Trac ticket 54460 and its changeset did resolve it in WordPress 5.9.0. I just retested and yes, the TT2 theme's "Live Preview" button links to the wp-admin/site-editor.php.

jffng commented 3 years ago

Bottom line is that Twenty Twenty Two can not be run with WP 5.8.2 and I assume anything below that as well.

I looked into this more. It's not that the theme can't be run with 5.8.2 and Gutenberg.

The problem is with manual installation using the GitHub generated zip. Github automatically appends the version string to it (twentytwentytwo-0.4.0), and Gutenberg's template resolver uses the directory name to locate the template, which breaks when it has the version tag or branch appended to its directory name.

Still looking into what the best path forward is here.

hellofromtonya commented 3 years ago

@jffng Heads up: this same problem with the version string caused a fatal error condition during 5.9 Beta 1. Investigation and discussion can be found in Trac ticket 54544.

kjellr commented 3 years ago

@kjellr Yes, I can confirm that Trac ticket 54460 and its changeset did resolve it in WordPress 5.9.0. I just retested and yes, the TT2 theme's "Live Preview" button links to the wp-admin/site-editor.php.

We still have this issue for prior versions though. Not sure how to solve it, but I opened this issue to track it: https://core.trac.wordpress.org/ticket/54575

jessefriedman commented 2 years ago

I came to github to share a similar experience. I have a site on WordPress.com and it had a managed copy of Gutenberg running 12.0.2. When I installed Twenty Twenty Two it told me that the Gutenberg plugin needs to be installed, but more importantly, it didn't tell me that the version I had was out of date. I didn't realize that the Gutenberg plugin was out of date because it was managed by my host.

I wasn't able to get a live preview working, but when I activated the theme it was a blank screen as described above. I deactivated the theme and did some investigating. I updated the plugin once I figured out that Gutenberg was out of date.

After installing Gutenberg 12.1.0, Twenty Twenty Two's live preview still didn't work but at least it wasn't a blank screen when I activated it.

If activating the theme without the proper requirements in place is going to white screen a site, we should probably make sure probably find a way to block the activation of the theme until they meet those requirements.

jffng commented 2 years ago

Thanks for sharing the feedback @jessefriedman.

When I installed Twenty Twenty Two it told me that the Gutenberg plugin needs to be installed, but more importantly, it didn't tell me that the version I had was out of date. I didn't realize that the Gutenberg plugin was out of date because it was managed by my host. I wasn't able to get a live preview working, but when I activated the theme it was a blank screen as described above. I deactivated the theme and did some investigating. I updated the plugin once I figured out that Gutenberg was out of date.

This will be resolved when 5.9 is released, since we plan to update the theme's required WP version to 5.9 which would prevent its activation in this scenario.

After installing Gutenberg 12.1.0, Twenty Twenty Two's live preview still didn't work

This is tracked in https://core.trac.wordpress.org/ticket/54549

If activating the theme without the proper requirements in place is going to white screen a site, we should probably make sure probably find a way to block the activation of the theme until they meet those requirements.

Agreed, which is why we plan to bump the required version. We left it at 5.8 for now to allow testing / development with the plugin active and things in flux between core and Gutenberg, but this can definitely cause some headaches as you describe.

There is still one scenario being discussed in #306 — how to handle if a user has TT2 activated and downgrades to a version < 5.9.

kjellr commented 2 years ago

Now that we're nearing release, I'm going to close this issue. If anyone has further thoughts to share on this topic, feel free to open up a new issue on Trac.