Fatal error: Call to protected method HTML_QuickForm2_Renderer_Array::exportMethods()

I performed an update to piwik 0.6.4 from v 0.5.1 or 0.5.4 [I’m not sure] and when I try to browse to the main page [index.php] I get the following message:

Fatal error: Call to protected method HTML_QuickForm2_Renderer_Array::exportMethods() from context 'HTML_QuickForm2_Renderer_Proxy' in /var/www/html/piwik/libs/HTML/QuickForm2/Renderer/Proxy.php on line 113

What can I do ?

Please help!

I am using PHP 5.1.6.

Thank you in advance !

I’ve opened a ticket. http://dev.piwik.org/trac/ticket/1495

Yeah, same problem here. I’m using CentOS 5.5. The upgrade from 0.6.3 to 0.6.4 was smooth. I liked the new look and everything, and then when I logged out, BAM! The error showed up and I can’t get back in.

It looks we ran into a PHP bug. http://bugs.php.net/bug.php?id=37632

The workaround is as follows:

  1. cd piwik/libs/HTML/QuickForm2
  2. edit the following files:

Element.php
Element/InputFile.php
Element/InputImage.php
Element/InputCheckbox.php
Element/Button.php
Element/Date.php
Element/Select.php
Element/InputSubmit.php
Element/Static.php
Renderer.php
Renderer/Array.php
Renderer/Default.php
Container.php
Node.php

  1. wherever you see any of these function declarations/definitions:
abstract protected function updateValue()
protected function updateValue()
protected function exportMethods()

change “protected” to “public”, e.g.,

abstract public function updateValue()
public function updateValue()
public function exportMethods()

Thank you !!!

One question though: if Quickform2 doesn’t support PHP < v5.2, what will you do ? Will you ship a customized version of Quickform ?

Cheers !

Yes, for as long as Piwik supports PHP 5.1.x, we’ll be distributing a modified version of HTML_QuickForm2.