Jump to content

Php object error - PHP Fatal error: Uncaught Error: Call to a member function proccess() on string


apryan

Recommended Posts

[14-Aug-2016 02:55:33 UTC] PHP Fatal error:  Uncaught Error: Call to a member function proccess() on string in /srv/prod/Html/Render/Abstract.php:271
Stack trace:
#0 /srv/prod/Html/Render/Abstract.php(257): Moto_Html_Render_Abstract->renderObject(Object(ObjectVO), Object(ContentHolderVO))
#1 /srv/prod/Html/Render/Holder.php(42): Moto_Html_Render_Abstract->renderElement(Object(ObjectVO), Object(ContentHolderVO))
#2 /srv/prod/Html/Render/Holder.php(26): Moto_Html_Render_Holder->_default(Object(ContentHolderVO))
#3 /srv/prod/Html/HelpRender.php(113): Moto_Html_Render_Holder->proccess(Object(ContentHolderVO), Object(WebsiteVO))
#4 /srv/prod/Html/HelpRender.php(92): Moto_Html_HelpRender->_renderHolders(Object(WebsiteVO))
#5 /srv/prod/templates/website/layout.tpl.php(297): Moto_Html_HelpRender->dispatch(Object(Moto_Html_Content), 'page')
#6 /srv/prod/sfTemplating/sfTemplateRendererPhp.php(36): require('/srv/a in /srv/prod/Html/Render/Abstract.php on line 271

Hi, i've ran into an issue with a template and wanted to get some help. I've done some printf's to try debugging the root cause and hitting a loss. If anyone has any additional suggestions on what I can try, please let me know. Any help is greatly appreciated!

 

current code from Abstract.php on line 271:

    public function renderObject($obj, $parent = NULL)
    {
error_log("Render: " . print_r($render, TRUE), 3, "/var/tmp/my-errors.log");
error_log("Obj: ".  print_r($obj, TRUE), 3, "/var/tmp/my-errors.log");
error_log("Parent: ".  print_r($parent, TRUE), 3, "/var/tmp/my-errors.log");
        $render = $this->getRender("object");
        if( $render != NULL )
        {
            return $render->proccess($obj, $parent);
        }

        return "";
    }

Output from error_log is posted here:

http://pastebin.com/WksZxECW

Link to comment
Share on other sites

yes, i don't know how either function work. getRender I believe is trying to pull the render id i believe though. Could you explain what the functions are suppose to be doing? i appreciate it.

    public function proccess($obj, $parent = NULL)
    {
        $this->_parent = $parent;
        $html = "";
        if( is_array($obj) ) 
        {
            $obj = (object) $obj;
        }

        if( method_exists($obj, "xxxinit") ) 
        {
            $obj->xxxinit();
        }

        $method_name = "_" . $obj->type;
        if( method_exists($this, $method_name) ) 
        {
            $html .= $this->$method_name($obj);
        }
        else
        {
            $html .= $this->_default($obj);
        }

        return $html;
    }

    public function getRender($name, $auto = true)
    {
        if( !preg_match("/^[a-z\\_]+\$/i", $name) ) 
        {
            return NULL;
        }

        if( !isset(self::$_renders[$name]) ) 
        {
            if( $auto ) 
            {
                $name = ucfirst($name);
            }

            $filename = str_replace("_", "/", $name) . ".php";
            if( !file_exists(dirname(__FILE__) . "/" . $filename) ) 
            {
                return NULL;
            }

            $class = "Moto_Html_Render_" . $name;
            if( class_exists($class) ) 
            {
                self::$_renders[$name] = new $class($this->_engine);
            }
            else
            {
                self::$_renders[$name];
            }

        }

        return self::$_renders[$name];
    }



Link to comment
Share on other sites

That code will return an object (or null). There's something else going on.

 

It seems $render isn't showing any data anyway as it is blank when the error occurs. I did move the function to within !=NULL and it still shows the error log but doesn't contain any data. Any idea what I could check? The error does occur on first page load. I was able to bypass the page load on some occasions however once in, no object is loaded on the pages. Just the background images. 

Link to comment
Share on other sites

For what it's worth, the error_log() code is executed before $render is defined. See the following snippet:

error_log("Render: " . print_r($render, TRUE), 3, "/var/tmp/my-errors.log");
error_log("Obj: ".  print_r($obj, TRUE), 3, "/var/tmp/my-errors.log");
error_log("Parent: ".  print_r($parent, TRUE), 3, "/var/tmp/my-errors.log");
$render = $this->getRender("object");
Edited by cyberRobot
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.