Not a bug BB-Code PHP callback not contain entity tag option when called from custom fields

Painbaker

Well-known member
Affected version
2.2
My callback

PHP:
public static function renderTag($tagChildren, $tagOption, $tag, array $options, AbstractRenderer $renderer)
{
    /** @var Entity $entity */
    $entity = $options['entity'];

    \XF::dump($entity);
}

Result from Thread custom field (Rich text box): null

Result from Thread post message:

1609865401718.png
 
Last edited:
This is something you need to account for. Entities/context for rendering is not guaranteed to be available. It's simply not available to custom fields in any context.
 
Top Bottom