Fixed Hard coded processor actions - code event missing

AlexT

Well-known member
Affected version
2.0.2
XF 2 provides a code event to listen to when a BB code renderer object is created ("bb_code_renderer", fired in the $container->factory('renderer') closure). Analogously, there should be a "bb_code_processor_action" code event fired in the $container->factory('processorAction') closure. This then would allow to add custom bbcode processor actions by modifying the processorActionMap array before the processor action classes are initialized.

Edit: On a second thought I suppose one could extend XF\SubContainer\BbCode to modify $container['rendererMap']... I still think a code event would be appropriate here, but feel free to remove this "bug report" if you disagree.
 
Last edited:
I think your current workaround for this is valid and goes some way towards what is the right approach for a code event. For the next release we've added two new code events: bb_code_renderer_map and bb_code_processor_action_map. These events allow those maps to be modified, which I think should do what you want.
 
These events allow those maps to be modified, which I think should do what you want.

I'm trying to add a processor action to process URLs in plain text before AutoLink turns them into links. The bb_code_processor_action_map event can be used to add processors to the map in the form of a class name (the class implements FiltererInterface) but adding an action to the map doesn't mean it will be called. How do you enable a processor action for a renderer?
 
Back
Top Bottom