Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSE: Switching template on post/page to default template/template generated by the theme failed with error "Updating failed. Invalid parameter(s): template" #59570

Closed
retnonindya opened this issue Dec 27, 2021 · 38 comments
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Pri] High Address as soon as possible after BLOCKER issues Template Selector [Type] Bug User Report This issue was created following a WordPress customer report

Comments

@retnonindya
Copy link

retnonindya commented Dec 27, 2021

Quick summary

Cc. @vinnykaur as the first responder

Switching post/page template from "Default theme" to any template created by the theme will render the error Updating failed. Invalid parameter(s): template and the post/page can't be updated.

Steps to reproduce

  1. Create a page or post.

  2. Click the dropdown block on "Template" section. Choose the one that was created by default. In this example, I'm using "Page without title" template.
    Screenshot 2021-12-27 at 4 29 32 PM

  3. ... And I can confirm the template "Page without title" is a template created by the theme (Quadrat/Quadrat Black)
    Screenshot 2021-12-27 at 4 32 54 PM

  4. See error and failed update attempt
    Screenshot 2021-12-27 at 4 35 02 PM

What you expected to happen

For the post/page to be able to switch templates properly

What actually happened

Error Updating failed. Invalid parameter(s): template

Context

Customer report and both Vinny and I are able to replicate it

Simple, Atomic or both?

Simple

Theme-specific issue?

Blockbase-themes: (I'm testing it using Quadrat theme (Quadrat Black), and Vinny tested it using theme Russell)

Also reported: Zoologist

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

No response

Available workarounds?

Yes, difficult to implement

Workaround details

The template switcheroo will work only with customized template (templates that we create from scratch)

@retnonindya retnonindya added [Type] Bug User Report This issue was created following a WordPress customer report labels Dec 27, 2021
@vinnykaur
Copy link

vinnykaur commented Dec 27, 2021

When I tried with the Russell theme, creating a custom template worked from the path:

... /wp-admin/edit.php?post_type=wp_template

But not from within the post.

Also, when I assign a custom template to a post, it shows the same error.

Screen.Capture.on.2021-12-27.at.14-13-27.mp4

@nagpai
Copy link
Contributor

nagpai commented Dec 27, 2021

I got this error today when I was trying out FSE (as a part of my training) on Blockbase theme

  1. Create a page with default theme and publish it
  2. Change the template to any others - I choseHeader and Footer only from the option on the right-side toolbar in editor of the page.
  3. I see this error

image

@hngdny
Copy link

hngdny commented Dec 28, 2021

This is affecting a Simple Site (Premium) user with the Zoologist theme (FSE is not enabled) :

4640480-zd

  1. Created a new blank page
  2. Changed template to 'Blank'
  3. Getting error Updating failed. Invalid parameter(s): template

I was able to replicate this on my test site (Zoologist, Premium plan)

image1

@supernovia
Copy link
Contributor

I'm seeing this on two simple sites, the one mentioned here:
https://wordpress.com/forums/topic/publishing-failed-invalid-parameters-template/

and on my test site. I tried enabling FSE on a test site to see if that would fix it. It didn't make a difference.

@KokkieH
Copy link
Contributor

KokkieH commented Dec 29, 2021

Another case in https://wordpress.com/forums/topic/how-to-hide-blog-page-titles-and-featured-images/?view=all, simple site using Russell theme

@KokkieH KokkieH added [Feature] Post/Page Editor The editor for editing posts and pages. Template Selector labels Dec 29, 2021
@KokkieH
Copy link
Contributor

KokkieH commented Jan 3, 2022

https://wordpress.com/forums/topic/template-3/?view=all, simple site on Zoologist

@aleone89
Copy link

aleone89 commented Jan 3, 2022

There's another report of this here: https://wordpress.com/forums/topic/new-post-updating-failed-invalid-parameters-template/?view=all > with the Russell theme.

@arinoch
Copy link

arinoch commented Jan 3, 2022

+1 for Russel. 4649640-zd-woothemes

@formosattic formosattic added [Pri] Normal Schedule for the next available opportuinity. [Pri] High Address as soon as possible after BLOCKER issues and removed [Pri] Normal Schedule for the next available opportuinity. labels Jan 4, 2022
@formosattic
Copy link

I was able to replicate as well. Set to High priority.

@Robertght
Copy link

Robertght commented Jan 8, 2022

Tagging @Automattic/cylon and @Automattic/theam here

In the case of 4667283-zen, the user commented with the following:

The problem is not related to the theme since I tried to change the theme, it didn't change anything. I even tried changing the page template from another account.

@gabriel-fuentes
Copy link
Collaborator

4673315 - zd

@formosattic
Copy link

+1 4673459-zd-woothemes

@creativecoder
Copy link
Contributor

I think this is resolved by D72778-code.

@KokkieH
Copy link
Contributor

KokkieH commented Jan 11, 2022

I've followed up with the forum threads to ask them to try again.

@essleeung
Copy link

I created a new simple site on a free plan for Quadrat Black today. When I make edits to a template, I'm still getting the Updating failed. Invalid parameter(s): template.

@AtrumGeost
Copy link
Contributor

AtrumGeost commented Jan 13, 2022

I was doing some dogfooding and found the same on the Zoologist theme:

  1. Open any published page and set the "Page without Title" template
  2. Click on Update
  3. Notice the error

Screen Shot on 2022-01-13 at 13:42:51

@supernovia
Copy link
Contributor

Came here to say I've seen this as well in a few themes.

@mattwiebe
Copy link
Contributor

Ok I think we got to the bottom of this. Should be fixed, please reopen if it persists!

@tvolpert tvolpert reopened this Mar 30, 2022
@jartes
Copy link
Contributor

jartes commented Apr 2, 2022

During some team testing, I found this error when trying to switch to a new page template on a simple site, and using the Blank Canvas theme.

@Greatdane
Copy link

I am unable to replicate the issue, so it seems intermittent. @jartes are you able to replicate it consistently? If so, can you provide steps to do so?

@Greatdane
Copy link

Closing this again for now, as no more reports and unable to replicate.

@metabreakr
Copy link

Reopening issue. Reported in 30878508-hc

@metabreakr metabreakr reopened this Apr 28, 2022
@rw-ye
Copy link

rw-ye commented May 2, 2022

Another report here: 4850193-zd-woothemes

I can reproduce the issue when creating a custom template and then trying to switch the template on the page to it.

Screen.Recording.2022-05-02.at.6.00.40.pm.mov
Screen.Recording.2022-05-02.at.6.14.52.pm.mov

@sophiegyo
Copy link

Another instance of this in 5182756-zen - I checked and was able to replicate.

Theme: Blank Canvas

It looks like I was able to apply the user's Homepage template to a test page, after creating my own test template?
Now what I see on the user's site is: My test-template shows the invalid paramteter(s) error when I try to select it. I am able to select the user's template. It's as if my test template being at the top of the list now lets the user's template work.

@cuemarie
Copy link

cuemarie commented May 4, 2022

📌 HOUSEKEEPING

  • Labels ✅
  • Priority ✅
  • Updated main description of report - No

📌 SCRUBBING

  • Tested on Simple ✅
  • Themes Tested: Farrow, Quadrat White, Blank Canvas

📌 FINDINGS/SCREENSHOTS/VIDEO

  • On a Personal Plan site, I tested the following themes and scenarios:

Farrow, Quadrat White, Blank Canvas with default settings - ❌ Not replicated

  • could switch a new page to any default template without error

Further Testing: Blank Canvas - ✅ Replicated

  • Sticking with Blank Canvas, I created a "new custom template" via Page Editor > New template, saved, and then returned to my page and continued to switch templates successfully - both to default and my new custom template.

  • Next, I went to the Site Editor and edited the default Home template. This moved it to the top of the Template list, and denoted I'd edited it. Then I returned to the page, and began switching templates again. Here, the issue recurred only when I selected my custom template:

Markup on 2022-05-04 at 11:36:06

Markup 2022-05-04 at 11 35 13

  • I returned once more to the page, and once again the error returned when I tried selecting the custom template for the page to use.
Screen.Capture.on.2022-05-04.at.11-39-33.mov

Further Testing: Quadrat White - ❌ Not Replicated

Last, I switched to Quadrat White once more:

  • With all default templates and no customizations made on templates, I can switch templates without issue.
  • With edits made to one of my default templates, I can still switch templates without issue.
  • Cleared customizations, then created a new custom template for the page. Can still switch templates (to new and default) without issue.
  • Edited the "Page without Title" template, then returned to page - can still switch templates without issue.
  • Edited the default "Page" template, then returned to page - still can't get the error to occur.

📌 ACTIONS

  • Marked as Triaged for Quality Squad review

@cuemarie
Copy link

cuemarie commented May 4, 2022

This is tough to replicate - for any future HE reports, please note the theme used, and provide as many steps you can share that would help us consistently replicate the error on a test site.

@mrfoxtalbot
Copy link

mrfoxtalbot commented May 5, 2022

I encountered this issue while using Twenty Twenty-Two

Screen Shot 2022-05-03 at 11 22 34

I also saw this "failed to save" message, but I am not sure if it is related:

Screen Shot on 2022-05-03 at 11:23:11

@formosattic
Copy link

+1 with theme Dorna, 5286915-zd-woothemes

@philnick206
Copy link

Also seeing this issue now on a site with the Quadrat theme.

  1. Created a new custom template in the Site Editor
  2. Tried switching a page (homepage) to the new template
  3. Observed error shown

CleanShot 2022-08-19 at 09 44 49@2x

@github-actions
Copy link

github-actions bot commented Aug 19, 2022

Support References

This comment is automatically generated. Please do not edit it.

  • 4640480-zen
  • 4649640-zen
  • 4667283-zen
  • 4673459-zen
  • 4850193-zen
  • 5182756-zen
  • 5286915-zen
  • 5496035-zen
  • 5581931-zen

@rickmgithub
Copy link

This feels like the same issue again.
The user was trying to add a new custom template but whenever they try to switch from default to their custom template it produces an error - Updating failed. Invalid parameter(s): template
I re-created the page as a blank page and set the custom template and copied the content from the previous page and this time it worked. So the issue appears to be in the switching of a published page.
Theme: Archeo

5496035-zen

@Addison-Stavlo
Copy link
Contributor

Addison-Stavlo commented Sep 14, 2022

Testing on Lynx theme

I wasnt able to repro given these instructions from @philnick206

Created a new custom template in the Site Editor
Tried switching a page (homepage) to the new template
Observed error shown

Nor could i repro instructions from @cuemarie here

However I am seeing that if I do everything from the page editor I can reproduce the issue until I reload the page.

  1. Visit the page editor
  2. Create a new template from the sidebar
    Screen Shot 2022-09-14 at 1 02 12 PM
  3. Try to 'update' changes.

The error is reproduced both on blockbase child themes as well as twenty-twenty-two for simple sites only. However, reloading the page allows us to set and save the newly created template with no error.

On Blank Canvas

@jeyip Just tested with @cuemarie 's instructions noted above and was able to repro.

@jeyip
Copy link
Contributor

jeyip commented Sep 21, 2022

Technical Notes

A few things I noted from testing. The endpoint is wp/v2/sites/210779820/pages/7 and the response looks like this:

{
    "body": {
        "code": "rest_invalid_param",
        "message": "Invalid parameter(s): template",
        "data": {
            "status": 400,
            "params": {
                "template": "template is not one of header-footer-only, blank, footer-only."
            },
            "details": {
                "template": {
                    "code": "rest_invalid_param",
                    "message": "template is not one of header-footer-only, blank, footer-only.",
                    "data": null
                }
            }
        }
    },
    "status": 400,
    "headers": {
        "Allow": "GET, POST, PUT, PATCH, DELETE"
    }
}

The controller couldn't locate our custom template -- it only found default templates. For anyone planning to work on this, be sure to touch base with @david-binda to see if he might have any hunches.

@david-binda
Copy link
Contributor

Thanks for the ping @jeyip ! I'm looking into the issue, feels like WordPress core bug related to a cache on a multisite install (thus affecting WPCOM simple sites only). I'll follow-up here once I have more details to share.

@syedshaon
Copy link

5581931-zen

@david-binda
Copy link
Contributor

I have deployed a fix for the issue ( D88570-code ).

@Addison-Stavlo
Copy link
Contributor

Thank you @david-binda ! I tested on my end and the issue seems resolved. Going to close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Pri] High Address as soon as possible after BLOCKER issues Template Selector [Type] Bug User Report This issue was created following a WordPress customer report
Projects
None yet
Development

No branches or pull requests