This project is read-only.

IHtmlFilter not registered when BodyPartDriver runs

Topics: Writing modules
Nov 4, 2011 at 11:13 PM
Edited Nov 4, 2011 at 11:18 PM

I've implemented a filter for BBCodes as proposed in this issue. However, the filter is not getting registered (although it implements IHtmlFilter, so also IDependency), it doesn't show up in the ctor of BodyPartDriver neither anywhere else (I tried a Controller ctor too, no luck: only the default BbcodeFilter is there). The module is enabled.

Strange is, it seems that (my) IHtmlFilters are not getting registered at all: I tried with an empty one (named TestFilter, so naming shouldn't be an issue) that was in the same file as the controller I called (and which works otherwise and gets any other dependencies correctly), but it wasn't registered either. I also tried to place the filter in the Services namespace (even Services folder) of the module, even in the same namespace as the built-in BbcodeFilter class, but no luck.

Markdown works...

What could be the problem?

Nov 5, 2011 at 1:05 AM

There is an IHtmlFilter for MArkdown which works fine.

Nov 5, 2011 at 1:09 AM

Just to eliminate possible oversights, is it decorated with an OrchardFeature attribute? Is the feature enabled?

Nov 5, 2011 at 2:11 AM

Thanks both of you!

It turns out I made a rookie mistake by not making the filter class public. This everything works.

Now I'm just tweaking the filter a bit and will release the module on the weekend.