mtyeh411 / mediawiki-bootstrap

A customizable responsive Bootstrap MediaWiki skin.
GNU General Public License v2.0
78 stars 19 forks source link

Strict Standards Error: Call to DOMDocument::loadXML() #3

Closed danieldinter closed 11 years ago

danieldinter commented 11 years ago

Hi,

installing this extension on a fresh mw 1.19.2 setup leads to the error Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically, assuming $this from incompatible context in C:\..\mediawiki\skins\bootstrap\Bootstrap.renderer.php on line 76.

The navbar and the sidebar do not show up. Instead there is this error.

Any idea for a fix?

danieldinter commented 11 years ago

Ok, fixed it by changing the constructor to

    public function __construct( $skin, $data ) {
        $this->skin = $skin;
        $this->data = $data;
        $this->doc = new DOMDocument();
    }

and call the method using $this->doc->loadXML(..). You should also add to your documentation that you have to provide content to the Bootstrap: pages or the bar elements will not show up.

And there is another violation of the PHP strict standards in Bootstrap.renderer.php on line 422. Change it to

        $arr = $this->skin->getPersonalTools();
        $userPage = array_shift( $arr );
mtyeh411 commented 11 years ago

Thanks for reporting the issue and providing a fix. I'm not noticing anything on my dev machine, but I will accept the pull request as the fix seems fairly innocuous.

Since I can't verify the problem/solution, would you mind sending a pull request? Thanks.

mtyeh411 commented 11 years ago

I committed changes as noted. Thanks for pointing this out. I appreciate the effort. Since a solution was posted, I am considering this issue closed.