vknt Posted September 19, 2012 Share Posted September 19, 2012 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 Link to comment Share on other sites More sharing options...
diogo Posted September 19, 2012 Share Posted September 19, 2012 Searching for that error message on Google returned two forum threads besides yours. Hope they will help somehow http://processwire.c...g-for-dummy-me/ http://processwire.c...ates-and-pages/ Link to comment Share on other sites More sharing options...
vknt Posted September 19, 2012 Author Share Posted September 19, 2012 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 More sharing options...
ryan Posted September 19, 2012 Share Posted September 19, 2012 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 More sharing options...
vknt Posted September 19, 2012 Author Share Posted September 19, 2012 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 More sharing options...
ryan Posted September 19, 2012 Share Posted September 19, 2012 Glad you got it solved. But I'm confused, how is a Page field linking to a template? Link to comment Share on other sites More sharing options...
vknt Posted September 19, 2012 Author Share Posted September 19, 2012 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 More sharing options...
ryan Posted September 20, 2012 Share Posted September 20, 2012 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 More sharing options...
apeisa Posted October 23, 2012 Share Posted October 23, 2012 I got this error also. Should be easy to reproduce with these steps: Create page field, that allows only certain template, ie. product-feature Add that field to a template (ie. product) Choose few pages from that field (not sure if this step is required) Change templates from all product-feature pages (I did this through API) Remove template (product-feature) 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 More sharing options...
ryan Posted October 24, 2012 Share Posted October 24, 2012 Thanks, I have added this as an issue in the queue. https://github.com/ryancramerdesign/ProcessWire/issues/132 1 Link to comment Share on other sites More sharing options...
benbyf Posted April 27, 2016 Share Posted April 27, 2016 I had the same issue just now on PW 2.7.2 - resolved after taking away a field from the erroring template. (field was dependent on a page that no longer existed) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now