We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Console Fatal error | Forum

Sean
Sean Apr 23 '15
[23-Apr-2015 05:41:21 Europe/London] PHP Fatal error:  Call to undefined method OW_HtmlDocument::getScripts() in /home/owned/public_html/ow_system_plugins/base/controllers/console.php on line 21


I'm getting this error quite a bit in my error log, I'm using the latest oxwall version.


Not a big issue but I just wanted to make you aware, maybe get it fixed in the next update?

ross Team
ross Apr 23 '15
Do you have Cloudflare enabled on your website?
Sean
Sean Apr 23 '15
Nope, never used it.
ross Team
ross Apr 23 '15
What do you have in ow_core/ajax_document.php file on lines

77-96?

Sean
Sean Apr 23 '15

public function getOnloadScript()


    {


        $onloadJS = '';




        ksort($this->onloadJavaScript['items']);




        foreach ( $this->onloadJavaScript['items'] as $priority => $scripts )


        {


            foreach ( $scripts as $script )


            {


                $onloadJS .= $script;


            }


        }




        return $onloadJS;


    }

ross Team
ross Apr 23 '15
that's odd, what do you have on lines 40 -56?
Sean
Sean Apr 23 '15
Humm, seems like my text editor wasn't reading the file correctly, this is actually what it shows:


77-96:

public function getScripts()    {        $jsUrlList = array();
        ksort($this->javaScripts['items']);
        foreach ( $this->javaScripts['items'] as $priority => $types )        {            foreach ( $types as $type => $urls )            {                foreach ( $urls as $url )                {                    $jsUrlList[] = $url;                }            }        }
        return $jsUrlList;    }


40-56:

 public function getOnloadScript()    {        $onloadJS = '';
        ksort($this->onloadJavaScript['items']);
        foreach ( $this->onloadJavaScript['items'] as $priority => $scripts )        {            foreach ( $scripts as $script )            {                $onloadJS .= $script;            }        }
        return $onloadJS;    }


Also, I have just noticed since upgrading to 1.7.3 I now have this in the ow_log/error.log file:


[Thu Apr 23 14:57:55 2015] [ow_core_log] [Error] Message: Argument 2 passed to OW_Event::__construct() must be of the type array, null given, called in /home/owned/public_html/ow_system_plugins/base/classes/console_list_event.php on line 9 and defined File: /home/owned/public_html/ow_core/event.php Line:61


I'm not sure if it's related?

dave Leader
dave Apr 23 '15

[Thu Apr 23 14:57:55 2015] [ow_core_log] [Error] Message: Argument 2 passed to OW_Event::__construct() must be of the type array, null given, called in /home/owned/public_html/ow_system_plugins/base/classes/console_list_event.php on line 9 and defined File: /home/owned/public_html/ow_core/event.php Line:61




that error just means that instead of sending a blank array if empty like so  


return array();


the just did 


something like 


$whatever = somevalue  


return $whatever;


and then if that value is empty its not an array is a null string.


well thats php....  but with js you have to trap the undefined


this sounds like a job for the developers i dont see anything i can put my finger on. 

The Forum post is edited by dave Apr 23 '15