Lack of interest Ability to add new rebuild tasks to XF\Job\User

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

DragonByte Tech

Well-known member
The cron job XF\Job\User's rebuildById function does not allow for add-ons to add their own custom rebuild features, without overwriting the whole method.

This can be fixed extremely easily:
    protected function rebuildById($id)
        /** @var \XF\Entity\User $user */
        $user = $this->app->em()->find('XF:User', $id, ['Profile']);
        if (!$user)

        $db = $this->app->db();



        $user->save(true, false);



    protected function updateColumns(\XF\Entity\User $user)
        $user->alerts_unviewed = $this->app->finder('XF:UserAlert')
            ->where('alerted_user_id', $user->user_id)
            ->where('view_date', 0)

        $user->alerts_unread = $this->app->finder('XF:UserAlert')
            ->where('alerted_user_id', $user->user_id)
            ->where('read_date', 0)

        $user->conversations_unread = $this->app->finder('XF:ConversationUser')
            ->with('Master', true)
            ->with('Recipient', true)
            ->where('owner_user_id', $user->user_id)
            ->where('is_unread', 1)

    protected function performRebuildTasks(\XF\Entity\User $user)

Upvote 6
This suggestion has been closed. Votes are no longer accepted.
Top Bottom