Problems with block methods

Permalink 1 user found helpful
Hi,
I've just noticed the following issues with my installation of the discussion addon and would really appreciate any help or suggestions.

The problem I'm having is to do with retrieving and displaying Block content related to a post:

1. When trying to reply to or edit a post I get:
Call to undefined method HtmlBlockController::getTextContent() in /public_html/clientname/packages/discussion/tools/reply_form.php

2. When listing blocks (replies) I get:
Fatal error: Call to undefined method HtmlBlockController::getContent() in public_html/clientname/packages/discussion/models/discussion_post.php on line 168

getTextContent() method exists in the bbcode block controller (and in the discussion_content/blocks_disabled controller) and the getContent() method exists in the discussion_post Model.

My question is, why would these methods be failing now?

I've added the following pages to my theme:
discussion.css
discussion.php -- as the page type - see code next
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php');
?>
<!-- container -->
<div class="container">
      <div class="main-header sixteen columns">
         <div id="logo" class="twelve columns alpha">
               <a href="/"><img src="<?php echo $this->getThemePath()?>/images/logo.png"></a>
         </div>
         <div class="four columns omega">
            <?php  
            $u = new User();
            if ($u->isRegistered()) { ?>
               <?php


.. and here's the code for my view.php file

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('elements/header.php');
?>
<!-- container -->
<div class="container">
<?php  
print $innerContent;
?>
</div>
<!-- container --> 
<?php
$this->inc('elements/footer.php');
?>


Any help would be great.

big thanks
m
opusdev
View Replies: View Best Answer
GregJoyce replied on at Permalink Best Answer Reply
GregJoyce
Hello,
Yeah I am not seeing this in a default install.

Have you overridden the model file? Does line 64 of your models/discussion_post.php say this:
public function getContentBlockTypeHandle() {return 'bbcode';}


Also, if you put your site into plain vanilla does the error go away? If it does, then you can work backwards from there to see perhaps which modification introduced the problem.
opusdev replied on at Permalink Reply
opusdev
Hi Greg,

Thanks a million for your reply.

Line 64 of models/discussion_post.php does indeed say:
public function getContentBlockTypeHandle() {return 'bbcode';}

I've reverted the site to the Plain Yogurt theme and I'm still seeing the issue.

Will soldier on and see what I can find.
opusdev replied on at Permalink Reply
opusdev
Okay,

So I un-installed and then re-installed the Discussions package, and got it working again.

I think the issue was that I added some navigation elements to the Default page types (discussion & discussion_post) in the C5 backend and something that I did was screwing with the page attributes.

It all seems to be working again. Thanks eversomuch for your help.

best
m