BB code context changes
The BB code system now supports extended approaches for allowing the renderer to know what entity it's rendering content from in most cases. This has created a large number of changes, but should make for a lot more flexibility with rendering. These changes include:
This method generally shouldn't have been called after the class was instantiated.
XF\Service\Conversation\Creator::isAutomated() has been renamed
This method is now
This method has also been added to the conversation reply and message editor services, along with support for disabling validations on the message.
The BB code system now supports extended approaches for allowing the renderer to know what entity it's rendering content from in most cases. This has created a large number of changes, but should make for a lot more flexibility with rendering. These changes include:
XF\SubContainer\BbCode::render()
has had its arguments changed. $content is now the 4th argument and $options is the 5th. The content argument must be specified, though it can be null. If you pass an array as the 4th argument and don't pass options, we will log this so you can update your code. This support will be removed in the future.XF\Service\Message\Preparer::__construct()
now defines an additional $messageEntity argument that should be passed whenever using it.- BB code rule set contexts can now be defined in "context:subcontext" format to allow more specific rendering and rules control. The contexts are now accessible via getters, so renderers can modify their behavior based on this if needed.
- The
bb_code()
templater function has renamed the $user argument to $content to represent that, ideally, it should be a content entity. If there isn't one, a user can still be passed as before. This argument must be provided, but can be null if there is nothing that can be given. - Templates now rarely pass options into the bb_code() function. Instead, if the $content implements
XF\BbCode\RenderableContentInterface
, thegetBbCodeRenderOptions()
method will be called. You can look atXF\Entity\Post
as an example. Note that this will likely have broken some template modifications, but they can now extend that method instead. - The
XF\EditHistory\AbstractHandler::getHtmlFormattedContent()
signature has changed, addingEntity $content = null
to allow passing content into the BB code renderer. This is an abstract function, so all edit history handlers will need to be updated for this.
This method generally shouldn't have been called after the class was instantiated.
XF\Service\Conversation\Creator::isAutomated() has been renamed
This method is now
setIsAutomated()
to be more consistent with similar methods in other services.This method has also been added to the conversation reply and message editor services, along with support for disabling validations on the message.