1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Extend Bytes Exhausted

Discussion in 'XenForo Development Discussions' started by silence, Nov 14, 2014.

  1. silence

    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!
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Shouldn't self:: be $this-> ?
     
  3. AlexT

    AlexT Well-Known Member

    Instead of

    PHP:
    $parent self::getPostById($postId$fetchOptions);
    try

    PHP:
    $parent parent::getPostById($postId$fetchOptions);
    Unless your goal was to create an endless loop ;)
     
    Chris D and silence like this.
  4. silence

    silence Well-Known Member

    Ah well I'm dumb haha!

    Thanks!
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    Heh me too. Didn't read that properly at all...
     

Share This Page