So I'm working on upgrading the CakeDC Comments Plugin to 2.0, and I've hit 
a roadblock.  

// in Comments/Controller/Component/CommentsComponent.php
function cleanHtml($text, $settings = 'full') {
App::import('Helper', 'Comments.Cleaner');
$cleaner = & new CleanerHelper();
return $cleaner->clean($text, $settings);
}

and I get the follow error print out  (any help for how I get the view to 
from the component to the helper)? 

*Warning* (4096) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Argument 1 passed to CleanerHelper::__construct() must be an instance of View, 
none given, called in 
C:\wamp\www\zuha\app\Plugin\Comments\Controller\Component\CommentsComponent.php 
on line 678 and defined [*APP\Plugin\Comments\View\Helper\CleanerHelper.php*, 
line *78*]

*Notice* (8) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Undefined variable: View [*APP\Plugin\Comments\View\Helper\CleanerHelper.php*, 
line *82*]

*Warning* (4096) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Argument 1 passed to Helper::__construct() must be an instance of View, null 
given, called in 
C:\wamp\www\zuha\app\Plugin\Comments\View\Helper\CleanerHelper.php on line 82 
and defined [*CORE\Cake\View\Helper.php*, line *144*]

*Notice* (8) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Trying to get property of non-object [*CORE\Cake\View\Helper.php*, line *146*]

*Warning* (4096) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Argument 1 passed to CleanerHelper::__construct() must be an instance of View, 
none given, called in 
C:\wamp\www\zuha\app\Plugin\Comments\Controller\Component\CommentsComponent.php 
on line 678 and defined [*APP\Plugin\Comments\View\Helper\CleanerHelper.php*, 
line *78*]

*Notice* (8) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Undefined variable: View [*APP\Plugin\Comments\View\Helper\CleanerHelper.php*, 
line *82*]

*Warning* (4096) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Argument 1 passed to Helper::__construct() must be an instance of View, null 
given, called in 
C:\wamp\www\zuha\app\Plugin\Comments\View\Helper\CleanerHelper.php on line 82 
and defined [*CORE\Cake\View\Helper.php*, line *144*]

*Notice* (8) 
<http://razorit.localhost/tasks/tasks/view/4ea17399-9790-4595-a330-0c58124e0d46/comment:0>:
 Trying to get property of non-object [*CORE\Cake\View\Helper.php*, line *146*]



*// NOTE : I've already added this to the CleanerHelper... (View $View, 
$settings = array())*

public function __construct(View $View, $settings = array()) {
foreach ($this->config['full'] as $key => $value) {
$this->{$key} = $value;
}
parent::__construct($View, $settings);
}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to