ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Forums 3.1.5 last_reply variable causes fatal error.

September 07, 2011 2:04am

Subscribe [2]
  • #1 / Sep 07, 2011 2:04am

    Kurt Deutscher

    827 posts

    Fatal error: Call to undefined method EE::select() in /home/####/system/expressionengine/modules/forum/mod.forum_core.php on line 10908

    {if logged_in}
                            <h2>CONNECT TO COMMUNITY</h2>
    <p>                        {exp:forum:topic_titles orderby="post_date" sort="desc" limit="4"}<br />
                                <a href="http://{thread_path=community-connection/viewthread}">{title}</a></p>
    
    <p>                            {exp:trunchtml chars="90" inline=" … <a href='{thread_path=' title='Read the full comment' rel='nofollow'>Read More</a>"}<br />
                                    {last_post_date format="%M-%d"} {last_author} wrote: {last_reply}<br />
                                {/exp:trunchtml}<br />
                                </p>
    
    <p>                        {/exp:forum:topic_titles}<br />
                            {/if}

    Even when all I have is the tag and the variable, I still get that error above. I’m showing the whole works to help you recreate it if needed. Again, I’ve already simplified down to just the tag and the variable, and I still get the error once {last_reply} is added.

    We’ve had to comment it out to get our pages to load.

    Thanks.

  • #2 / Sep 07, 2011 11:31am

    Mark Bowen

    12637 posts

    Hi Kurt,

    Some of your code above is being cut-off by the forums. Could you possibly upload a zipped text file of the code maybe?

    Specifically the trunchtml code has a path variable in there which is missing some characters.

    I’m going to give this a go on an install I have running so if you can get that code across to me that would be great thanks.

    Mark

  • #3 / Sep 07, 2011 2:13pm

    Kurt Deutscher

    827 posts

    Hi Mark,

    All you need to trigger the error is this:

    {exp:forum:topic_titles orderby="post_date" sort="desc" limit="4"}
        {last_reply}
    {/exp:forum:topic_titles}

    Everything else works like a charm.

    {last_reply} appears to be the “bad-boy” here.

  • #4 / Sep 07, 2011 2:31pm

    Mark Bowen

    12637 posts

    Hi Kurt,

    Thanks for the code there. I’ve just tested this out and can confirm there’s something not quite right here. I just took a look at the line in the source code and I think that it might be missing $this->EE->db->select whereas now it has the db missing from it.

    I think there might be a couple of other things missing too from that statement but I may be wrong though as this kind of programming is not my strong-point so will give a heads up to the dev crew on this and will get back to you as soon as I’ve heard anything.

    Thanks.

    Mark

  • #5 / Sep 07, 2011 2:56pm

    Mark Bowen

    12637 posts

    Hi Kurt,

    Actually after a little more playing around on my install I noticed that whilst I had a forum thread with one post in it I didn’t actually have any replies to the post and this is what was producing the error for me.

    Is that a possibility on your install maybe? Do you have replies to the latest forum thread yet?

    Thanks.

    Mark

  • #6 / Sep 08, 2011 2:53am

    Kurt Deutscher

    827 posts

    Hi Mark,

    I liked your first reply better. ;~D (quite the editing job you’ve done on this post today!)

    There was at least one of the topics that doesn’t have a reply yet, but the rest do.

    Seems like the variable should fail more gracefully when there’s no results. And I believe this was working prior to the latest released version of the forums.

    Thanks for digging into this one for me.

    Would love a patch for this client.

  • #7 / Sep 08, 2011 5:23am

    Mark Bowen

    12637 posts

    Hi Kurt,

    Just to keep you informed I’ve gone ahead and placed a bug report about this in the tracker - https://support.ellislab.com/bugs/detail/16495/.

    I believe that my first idea was possibly correct on this in that the file is missing a db in the code.

    I think I had probably edited the file last night and left the db part in whilst I was checking this and when it was working after I had added more threads and replies I thought it was then working however I’ve just come back today and checked and I can see that I had indeed left my modified code in there so I believe this is why it was working for me.

    I’ve also posted internally about this so hopefully we will hear something back on this one either via the bug report or I will hear internally.

    Either way, as soon as I hear anything on this I will let you know.

    Thanks for your patience on this one.

    Mark

  • #8 / Sep 08, 2011 2:05pm

    Mark Bowen

    12637 posts

    Hi Kurt,

    Just keeping you up to date on this one. I’ve escalated this to the dev team to get some input on the issue.

    Thanks for your patience whilst we figure this one out.

    Mark

  • #9 / Sep 08, 2011 2:20pm

    Kurt Deutscher

    827 posts

    Thanks for keeping me in the loop Mark!

  • #10 / Sep 09, 2011 11:29am

    Mark Bowen

    12637 posts

    Hi Kurt,

    Just to let you know that I’ve now had it confirmed that I was right in my thinking that the db is missing from the core code.

    The bug report will be updated but for now if you want to get this working yourself then you would need to change line 10908 of system > expressionengine > modules > forum > mod.forum_core.php to read as :

    $rquery = $this->EE->db->select('topic_id, body as last_reply, parse_smileys')

    That should then get it all working for you. Once the bug has been marked as resolved though that will mean when the new version of ExpressionEngine comes out this will work straight out of the box.

    Thanks for bringing up the error with us and hope that helps out a bit.

    Mark

  • #11 / Sep 09, 2011 10:32pm

    Mark Bowen

    12637 posts

    Closing thread as bug has been confirmed and a fix is in place for the next version of ExpressionEngine.

    If anyone else is having this issue then the fix is in the bug report located here.

    You can either apply that fix to your file or wait until the next version of ExpressionEngine comes out and that will also fix you up.

    Thanks,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases