Forum
Fatal error: Class 'PerchBlog_Posts' not found
I started to write this item earlier to ask for possible causes. But then I tried a few things and diagnosed the cause (and fixed it). However it could happen to others so perhaps its a bug and I've therefore documented it below.
[30-Aug-2016 16:57:20 UTC] PHP Fatal error: Class 'PerchBlog_Posts' not found in /home/*******/public_html/perch/addons/apps/perch_blog/modes/list.pre.php on line 12
I was initially unable to repeat it myself but it happened twice for my customer. Its a new Perch Blog install on an existing Perch setup, and new blog we've started that she was trying to take a look at. I was sending her to www.**********.co.uk/perch/addons/apps/perch_blog/ to see the test blog entries I've worked on for her. When she tried the link she got the PHP Fatal Error message.
Here's the diagnostics (with the domain name removed) ...
SUMMARY INFORMATION
Perch: 2.8.31, PHP: 5.6.19, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/******/public_html/perch
PERCH_CORE: /home/******/public_html/perch/core
PERCH_RESFILEPATH: /home/******/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 10M, Max POST 8M, Memory: 64M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/******/public_html
HTTP_HOST: www.*********.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
As it worked fine for me (as a Perch Admin) but we got this error for her (as a Perch Editor), I went to the Perch Settings and took a look at the Roles for the Editor. As Perch Blog had just been installed, none of the privileges were ticked. Quite understandable, of course. So I ticked them all and now the PHP Fatal Error has gone away.
So, maybe its a bug? Perhaps trying to visit www.**********.co.uk/perch/addons/apps/perch_blog/ (when you don't have the right privilege to do anything with Perch Blog) should actually show some sort of 'role/privilege' error rather than a PHP Fatal error?
Hope this is useful? Graham
That was a bug in 5.0, certainly.