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.
 
it would break backwards-compatibility for every single add-on that implements one of those handlers

For this issue where there is a HUGE number of addons that break because of a new Xenforo change, is it possible to "detect" the addons that will break ? Forinstance, use a query that scans the code of all the addons and detects if they will break on a new Xenforo version ? Maybe they could be given a warning in their discussion thread ?

I admit the easier way would be just to educate addon makers of the changes and have them make the changes. This will work well for the addons that are still being updated. But MANY other addons aren't so lucky. Quite a few addons might "die" because simple code changes aren't made. I know Xenforo takes no responsibility for addons and their demise from lack of updating ... but I wonder if certain code changes may be more easily handled for the more marginal developers and addons ?

It does feel like one of the next versions, likely version 3.x will break many things.

In the past, has Xenforo put out "developer videos" or posts about code changes to walk developers through the needed changes ? Just curious.
 
Back
Top Bottom