Jump to content

Invalid value sent to Page::setTemplate after template name change


vknt
 Share

Recommended Posts

Hi all,

I'm getting this weird error after changing the name of a template.

Invalid value sent to Page::setTemplate

The template is connected to 10 pages, as you can see in the attachment. But after name change, it stopped working.

I don't have a db backup, because I was doing pretty normal stuff, so I hope someone can help fix this.

Thx in advance.

Valentijn

post-23-0-56684000-1348049782_thumb.png

post-23-0-29826500-1348049825_thumb.png

Link to comment
Share on other sites

Thanks Diogo, I've looked into those posts before I started this topic, but I don't really understand what the're saying and it seem to be a subproblem of another problem for those topics.

But thanks for trying to help out!

V

Link to comment
Share on other sites

The name of a template really shouldn't matter since anything referencing it stores it as an ID (number). But it sounds like that old template name must be somewhere, somehow. I'm assuming the new template name is "page_parc". Have you tried changing the template name back? And if so, did that fix it? What 3rd party modules are installed? Are you using any "cache" fieldtypes?

Link to comment
Share on other sites

Hi ryan, I don't use any third-party modules, and I've tried to change the template name back, problem remained.

But when you said the old template must be somewhere I searched for other template references and found the problem: it was a Page field that was linking to a template that I had removed, so it had nothing to do with the renaming of the template although I thought it was connected to that change.

So thanks a lot! Problem solved!

Link to comment
Share on other sites

Hi Ryan, to be more exact:

- The Page field was linking to page that didn't exist anymore (set as parent for selection)

- The template of that page didn't exist anymore

- The field allowed to create a page from within the field, with a template that didn't exist anymore.

So I guessing he was giving the error based on one of those 3?

Link to comment
Share on other sites

So I guessing he was giving the error based on one of those 3?

Thanks for this info. It's hard to tell, still not sure where it was picking up the reference to the template from. Please let me know if you ever see it again.

Link to comment
Share on other sites

  • 1 month later...

I got this error also. Should be easy to reproduce with these steps:

  1. Create page field, that allows only certain template, ie. product-feature
  2. Add that field to a template (ie. product)
  3. Choose few pages from that field (not sure if this step is required)
  4. Change templates from all product-feature pages (I did this through API)
  5. Remove template (product-feature)
  6. Edit page with template product

I think in my case the required template setting in page field what was causing the error, not the selected pages. Since I changed that from field settings everything started working.

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...