Future fix ViewableInterface class isn't used as much as it should be

TickTackk

Well-known member
Affected version
2.3.0 Beta 6
Currently, in following classes
Code:
XF\Tag\AbstractHandler
XF\Service\ModerationAlertSendableTrait
XF\Search\Data\AbstractData
XF\Reaction\AbstractHandler
XF\NewsFeed\AbstractHandler
XF\Mvc\Controller
XF\Like\AbstractHandler
XF\InlineMod\AbstractHandler
XF\FeaturedContent\AbstractHandler
XF\EmbedResolver\AbstractHandler
XF\ContentVote\AbstractHandler
XF\Bookmark\AbstractHandler
XF\ApprovalQueue\AbstractHandler
XF\Api\Controller\AbstractController
XF\Alert\AbstractHandler
XF\Job\ContentIndexNow

This code or something similar is still used:
PHP:
if (method_exists($entity, 'canView'))
{
    return $entity->canView($error);
}
Instead of checking if $entity (or $content) implements ViewableInterface.
 
This is deliberate as it stands because it would break backwards-compatibility for every single add-on that implements one of those handlers until they're updated to implement the interface. We can reconsider in the future.
 
Top Bottom