Extend Bytes Exhausted

silence

Well-known member
So I'm extending XenForo_Model_Post and simply using this function:
Code:
    public function getPostById($postId, array $fetchOptions = array())
    {
        $parent = self::getPostById($postId, $fetchOptions);

        return $parent;
    }

However when I click the post number in the thread, it spits out this error:
Code:
Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 130968 bytes)

What would be triggering an exhaustion of memory and how can I code around this?

Thanks!
 
Instead of

PHP:
$parent = self::getPostById($postId, $fetchOptions);

try

PHP:
$parent = parent::getPostById($postId, $fetchOptions);

Unless your goal was to create an endless loop ;)
 
Instead of

PHP:
$parent = self::getPostById($postId, $fetchOptions);

try

PHP:
$parent = parent::getPostById($postId, $fetchOptions);

Unless your goal was to create an endless loop ;)
Ah well I'm dumb haha!

Thanks!
 
Back
Top Bottom