Iain Posted July 3, 2012 Share Posted July 3, 2012 Hi folks. I've set up a new site, and set up new templates and pages in exactly the same way as I have done before. But whenever I try to edit a default page (like the 404 page, the site map or whatever) in the admin section I get a 500 error. Turning on the debug mode gives the following error: Fatal error: Class 'Pagefiles' not found in /home/ [...] /wire/core/Pageimages.php on line 20 Obviously I've taken some of the path out, but you get the idea. I can edit my own new pages fine, but whenever I try to edit the others this comes up. The Pagefile file is in the right place, and the error is on a line which defines a new class which extends the Pagefiles class. Any ideas what I can try? Thanks Link to comment Share on other sites More sharing options...
ryan Posted July 3, 2012 Share Posted July 3, 2012 What version of ProcessWire and what version of PHP? I've seen this error before, back in PW 2.0 and in older versions of PHP, but don't recall exactly why it occurred, so need to ask questions. Link to comment Share on other sites More sharing options...
Iain Posted July 4, 2012 Author Share Posted July 4, 2012 It's the latest version of Processwire, running on PHP 5.3.13 and Apache 2.2.22... Link to comment Share on other sites More sharing options...
Iain Posted July 4, 2012 Author Share Posted July 4, 2012 Well I've worked out where the problem lies, even if I can't fix it easily. It's the default templates. I went into the database and changed the template id on my old 404 and About pages to that of my new pages and it now works... not sure what it is about the standard templates that's breaking it though. 1 Link to comment Share on other sites More sharing options...
ryan Posted July 5, 2012 Share Posted July 5, 2012 Thanks for posting back what you found. It remains a mystery for the moment, as I don't know how the changes you made could account for the error it fixed. But if what you did seems to have fixed it, then I also don't see any harm in it either. Please let me know if you come across a similar situation in the future. If possible, I'd like to get access to it so that I might be able to open the hood and see what's really happening in the engine room. Link to comment Share on other sites More sharing options...
Iain Posted July 5, 2012 Author Share Posted July 5, 2012 It's on a dev server at the mo, so once it goes live I'll leave the dev version set up and give you a shout 1 Link to comment Share on other sites More sharing options...
Iain Posted July 10, 2012 Author Share Posted July 10, 2012 Right. New development. I added the "images" field into my nicely working template, and can no longer edit any of the pages. Not only that, whenever I try to remove the field from the template in the backend, I get the same error... so I'm a bit stumped. I'm using the Moderna admin template if that makes any difference... Update: I managed to remove the images field by scrubbing that row in the database table, and created my own field called "Pictures" with the basic unlimited image settings (to replicate the default images field). Assigning that new field to the template has the same effect - that error when I edit the page or try to remove it from the template. It's clearly an issue with the image uploader, but I've got absolutely no idea how to fix that... Link to comment Share on other sites More sharing options...
ryan Posted July 10, 2012 Share Posted July 10, 2012 Try switching back to the default admin theme, just in case that's got something to do with it. Because the errors you mentioned sound unique and unusual, I would also suggest running a database repair. This is quick and easy to do from PhpMyAdmin--let me know if you need help. Link to comment Share on other sites More sharing options...
Iain Posted July 10, 2012 Author Share Posted July 10, 2012 I've just done a full DB repair and that didn't work, I've just done a full check as well and every table came back OK. I'll switch the theme back when I get home... what's the best way of doing that? Link to comment Share on other sites More sharing options...
ryan Posted July 10, 2012 Share Posted July 10, 2012 You can just rename your /site/templates-admin/ to something else. If I want to disable a custom admin theme temporarily, I just rename it to /site/_templates-admin/ (prepend an underscore or some character to it). Link to comment Share on other sites More sharing options...
Iain Posted July 10, 2012 Author Share Posted July 10, 2012 Right. Resetting the theme broke something, so I re-uploaded the original templates-admin folder and that sorted that little issue. But the images problem remained. While I had the download handy I uploaded the entire core directory again, and that seems to have fixed the main 500 error problems. I've also re-enabled the other admin template and that hasn't broken anything, so I guess something was messed up in the core directory. Weirdly I downloaded the "broken" core folder and compared them; the only difference seems to be that Notepad++ recognises the newly installed one as UNIX, and the other non-working version as Windows/Dos. Whether that's a result of FTP activity I don't know, but my host is Linux based so it seems odd to be picked up as a Windows file. Oh well. It's working. Thanks for all of your suggestions Link to comment Share on other sites More sharing options...
Pete Posted July 10, 2012 Share Posted July 10, 2012 By "core" I guess you mean "wire". It does sound like something odd happened there but good to hear re-uploading it fixed things. Just a note on the admin folder - where Ryan said to rename the one in the site folder this would default to the admin theme in the wire folder then to rule out a custom theme issue. Basically keeping any custom modules or themes in the site directory means that you can simply overwrite the wire directory with a new version to upgrade without overwriting any custom modules or themes in the site directory - simple upgrade path Link to comment Share on other sites More sharing options...
Iain Posted July 10, 2012 Author Share Posted July 10, 2012 Not the whole "wire" folder, just the "core" folder within that. As for the admin theme, I must confess I've just realised I hadn't read the instructions properly. I'd uploaded it into the wire folder, not the site folder. No wonder it broke when I renamed it... It's all straight and in the right place now! Link to comment Share on other sites More sharing options...
Pete Posted July 10, 2012 Share Posted July 10, 2012 Ah right, that core folder. Yup - either way you can overwrite the whole wire folder if you think there's something wrong with it without messing up the rest of your site which is handy. 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