0
b2evolution

b2evolution v4: Fatal error: Class ‘CommentList’ not found

By 23rd June 2013 No Comments

We’ve just been updating all our b2evolution blogs from version 2 to version 4.

It’s been a while since we did such an update, because b2evolution is a pretty robust platform anyway and why make work for yourself? But as we have a whizzy new server and had to move it all over anyway, it seemed like the right time to make the upgrade. Luckily for us the upgrade is very easy and it almost manages itself, and the skins which we have modified quite heavily over the years seem to make the translation to the new version almost without adjustment.

We did have one – and only one – niggling problem with the upgrade on this very blog. After updating to version b2evolution 4.1.7 the whole blog worked well, until comments needed to be displayed. The main pages worked fine, but as soon as comments were required, for example in displaying a full blog post, the page just stopped loading just after the main body. This meant that a lot of the skin javascript in the page didn’t load either (as it’s at the end of the page) so it didn’t render fully either.

So, what to do? Read on to find out. 

First, we edited conf/_advanced.php and turned on error display by uncommenting the following line (line 59 for this blog, yours may vary):

// ini_set( ‘display_errors’, ‘on’ );

That then allowed us to see the error that was causing the problem, which popped up at the bottom of the page (a few other warnings also showed up but we ignored them. The one that said ‘fatal error’ seemed to be more important somehow. ) 

The error read: 

Fatal error: Class 'CommentList' not found in 
/skins/natural_pink/_item_feedback.inc.php
on line 156

The name of the skin we use on this blog is natural_pink, so if you’re seeing this error that bit will probably be different for you. 

What had happened was that the new blog system was using a slightly different set of core files, and this natural_pink skin was not fully compatible with it – specifically the file mentioned.

One easy solution is to just delete the copy of _item_feedback.inc.php which is in the natural_pink folder. This should then let b2evo use the default (new) version which is in the main blog folder. We tried that, and it worked! If you have this problem we’d suggest you try that first too – keep a copy of the file though, in case you need to put it back.

But we were not quite happy still –  alas by removing the old customised file we also lost a lot of modifications to the skin which we rather wanted to keep. So would it be possible to adjust the old file so it would work with the new blog system? Indeed it was. 

With a bit of detective work on Google we found some very helpful – if curt – advice on the Hybride Anekyu blog.  The author writes (we paraphrase slightly for clarification):

To fix the fatal error, you can completely remove line 156 from the file _item_feedback.inc.php or just comment it out, and replace that line with this:

 $CommentList = new CommentList2( $Blog );

And your blog should work now! 

 That’s what we did, and you can see by looking at this blog that it worked. It seems likely that this hack would work for any b2evo 4.x installation. If you try it, let us know how you get on below. 

Leave a Reply