Resource icon

[Banxix] Auto Close Threads 1.0.1 Patch 2

No permission to download
Your thread view return null on $thread which should be \XF\Entity\Thread. I'm afraid it is not my addon's fault.

I implement a small fix for you. It check if the $thread is instance of Thread, but since your $thread is null, the auto close is not triggered.

I'm getting the identical error, ONLY when this addon is enabled.

1573790884323.png
 
Last edited:
@Banxix I've been able to suppress the error by doing the following:

Editing /Banxix/AutoCloseThreads/XF/Entity/Thread.php line 56 with:

PHP:
        else
        {
            if (isset($entity->post_date)) {
                if ($entity->post_date + (\XF::options()->autoCloseThreadsTimeFactorMinutes * 60) < time())
                {
                    $this->threadStateClosed();
                }
            }

        }
 
@Banxix I've been able to suppress the error by doing the following:

Editing /Banxix/AutoCloseThreads/XF/Entity/Thread.php line 56 with:

PHP:
        else
        {
            if (isset($entity->post_date)) {
                if ($entity->post_date + (\XF::options()->autoCloseThreadsTimeFactorMinutes * 60) < time())
                {
                    $this->threadStateClosed();
                }
            }

        }

Thank you, I missed the case where entity does not exist (for some reaons, because it should always exist). This fix should be enough.
 
Last edited:
Top Bottom