Unexpected Errror when adding a new page
Argument 1 passed to Concrete\Core\Page\Type\Type::createDraft() must be an instance of Concrete\Core\Page\Template, null given, called in /home/tucker25/public_html/concrete/concrete/controllers/backend/page.php on line 30 and defined
I don't know if it is related or not, but when I was setting up the site on a localhost I started to get another error when adding a new page. I figured I had messed something up and decided to set the site up fresh on a server.
An exception occurred while executing 'select cID from Pages where cParentID in () and cInheritPermissionsFromCID = ': SQLSTATE: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and cInheritPermissionsFromCID =' at line 1
I have absolutely no idea what this could be, but my project is scuttled until I can find a solution.
When I first uploaded my template I accidentally uploaded an old version. When I realized that, I uninstalled and deleted the template and then uploaded the new version and installed it. The new version had the same name. I realize now that what I should have done is simply overwrite the old version with the new version via ftp, but I wasn't thinking and I deleted and replace it through the concrete5 dashboard instead. I think somehow having two templates with the same name broke the system. I'm not completely sure but that's my theory.
The error I got previously seems to have had something to do with messing around with page types. But really this is all a bit over my head.
There should really be something in the concrete5 system that can either handle this situation or prevent the user from doing it. I still have no idea how to fix it. Since it's a new site I ended up erasing the site and database completely and starting over. It seems to work great now. But this could have been a huge problem with a finished site.
Things that I would try if a new install is unworkable:
- Switch to the Elemental theme and switch back as another user suggested
- install your theme again with a different name. installing a theme twice with the same name seems to have caused one of my problems
I'll try and remember other things that seemed to help and report back. It's been a little while since I dealt with this.
I probably did put the system in an unstable situation - the problem is that it's difficult to avoid doing hazardous manipulations when you're in the rush of development....
1. Always develop with the cache turned off
2. Enable full debugging environment
3. Do regularly database backup (to get back to before it breaks).
4. Always try to debug your code before debugging the core.
5. Do revision backup of your files to be able to get back to a point where it works.
I have now made 7 full sites (4 with custom themes), and during development it broke a lot. 9 out of 10 times the error is in the code you write, so it should always be possible to get out of trouble basically by correcting the code.
Remember that software development is all about code written in files. And one fault character can break anything.
Just my ten cent...