I have had an exception while trying to add a custom hook method so I can have a separate censored.txt - not one hardcoded from the CONFIG define.
I have the following in config:
fm_bbcode:
config:
hooks:
mensor:
class: WR\CommentBundle\Markup\Censor
classname: Censora
filter_sets:
my_forum_filter:
locale: en
xhtml: true
filters: [ default, quote ]
whitelist: [ b, quote ]
my_comment_filter:
locale: en
xhtml: true
filters: [ default, block, code, list, quote, text, url, link, color ]
hooks: [ Censora ]
I have copied and modified Censor Hook but I get: Catchable Fatal Error: Argument 1 passed to Decoda::addFilter() must be an instance of DecodaFilter, instance of WR\CommentBundle\Markup\Censor given, called in /home/valqk/projects/mysite.com/vendor/bundles/FM/BbcodeBundle/Decoda/DecodaManager.php on line 114 and defined in /home/valqk/projects/mysite.com/vendor/php-decoda/decoda/Decoda.php line 193
after changing line 193 from:
$code->addFilter(new static::$extra_hooks[$hook]());
to
$code->addHook(new static::$extra_hooks[$hook]());
it started working.
I suppose it's just a typo but anyway...
I have had an exception while trying to add a custom hook method so I can have a separate censored.txt - not one hardcoded from the CONFIG define. I have the following in config: fm_bbcode: config: hooks: mensor: class: WR\CommentBundle\Markup\Censor classname: Censora filter_sets: my_forum_filter: locale: en xhtml: true filters: [ default, quote ] whitelist: [ b, quote ] my_comment_filter: locale: en xhtml: true filters: [ default, block, code, list, quote, text, url, link, color ] hooks: [ Censora ]
I have copied and modified Censor Hook but I get: Catchable Fatal Error: Argument 1 passed to Decoda::addFilter() must be an instance of DecodaFilter, instance of WR\CommentBundle\Markup\Censor given, called in /home/valqk/projects/mysite.com/vendor/bundles/FM/BbcodeBundle/Decoda/DecodaManager.php on line 114 and defined in /home/valqk/projects/mysite.com/vendor/php-decoda/decoda/Decoda.php line 193
after changing line 193 from: $code->addFilter(new static::$extra_hooks[$hook]()); to $code->addHook(new static::$extra_hooks[$hook]()); it started working. I suppose it's just a typo but anyway...