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
<?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
if (Config::get("ENABLE_USER_PROFILES")) {
$userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>';
} else {
$userName = $u->getUserName();
}
?>
<div class="loggedin">
<?php echo t('Hello <b>%s</b>.', $userName)?> <a href="/login/logout"><?php echo t('Logout')?></a>
</div>
<?php } else { ?>
<div class="loginbutton button">
<a href="/login">LOGIN</a>
</div>
<div class="registerbutton button">
<a href="/register">REGISTER</a>
</div>
<?php } ?>
<?php
$search = new Area('Search');
$search->display($c);
?>
</div>
</div>
<div class="three columns">
<?php
$menu = new Area('Menu');
$menu->setBlockLimit(1);
$menu->display($c);
?><div class="menufooter"><img src="<?php echo $this->getThemePath()?>/images/menublock_darkgrey_bottom.png" alt=""/></div>
<?php
$left = new Area('Left');
$left->setBlockLimit(1);
$left->display($c);
?>
</div>
<div class="nine columns">
<?php
$u = new User();
if (in_array($this->controller->getTask(), array('track','do_track','remove_track'))) {
$u = new User();
$uID = $u->getUserID();
Loader::packageElement('discussion_track', 'discussion', array('c' => $c, 'uID' => $uID, 'actionTrack' => $this->action('do_track'), 'actionRemoveTrack' => $this->action('remove_track'), 'dTrack' => $dTrack, 'trackSuccess'=> $trackSuccess, 'trackRemoved' => $trackRemoved));
} else {
Loader::packageElement('discussion_breadcrumb', 'discussion');
//Loader::packageElement('discussion_filter_form', 'discussion');
$a = new Area('Main');
$a->display($c);
Loader::packageElement('discussion_popup_form', 'discussion', array( 'postData'=>array('monitorPost'=>1, 'showTags'=>1, 'tagsValue'=>$tagsValue), 'tags'=>$tags, 'captchaRequired'=>$captchaRequired, 'anonAttachments'=>$anonAttachments ));
?>
<ul class="ccm-discussion-menu">
<?php if($u->isRegistered()) { ?>
<li><a href="javascript:void(0)" onclick="ccmDiscussionTrack.viewTrackOverlay('<?php echo $this->action('track')?>','<?php echo $this->action('do_track')?>','<?php echo $this->action('remove_track')?>');">
<?php echo ($dTrack->userIsTracking($u->getUserID())? t("Stop Monitoring") : t("Monitor")) ?></a></li>
<?php } ?>
<?php
if(!$closed) {
?>
<li>
<a href="javascript:void(0)" onclick="<?php echo $startDiscussionAction?>"><?php echo t('Start Discussion')?></a>
</li>
<?php } ?>
</ul>
<iframe src="" style="display: none" border="0" id="ccm-discussion-frame" name="ccm-discussion-frame"></iframe>
<?php if($preload) { // pre-open the form ?>
<script type="text/javascript">
<!--
$(document).ready(function () { <?php echo $startDiscussionAction?>; } );
//-->
</script>
<?php } ?>
<?php } ?>
</div>
<div class="four columns">
<?php
$right = new Area('RightSide');
$right->display($c);
?>
</div>
<!-- footer -->
<div class="sixteen columns footer_row">
<?php
$this->inc('footer_inc.php');
?>
</div>
</div><!-- container -->
<?php
$this->inc('elements/footer.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
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:
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.