Page 1 of 1

Error: Call to undefined Method

Posted: 11 Jul 2008, 13:17
by DerRuhri
Hello,

when I installed the Phoca Guestbook on a local test installation,
Installation and Creation of Guestbook worked fine.
Also no error when trying to create a link in the main menu
(to the one and only guestbook)
But when I try to click on the menu item,
the following warning and error show instead of the guestbook:

Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in
[site root]\components\com_phocaguestbook\assets\library\HTMLPurifier\Lexer\DOMLex.php on line 58

Fatal error: Call to undefined method domdocument::loadHTML() in
[site root]\components\com_phocaguestbook\assets\library\HTMLPurifier\Lexer\DOMLex.php on line 62

Short overview of the system:
Phoca Guestbook: 1.3.0 beta
Joomla: 1.5.4 German
XAMPP 1.6.7 for Windows
- Apache HTTPD 2.2.9
- MySQL 5.0.51b
- PHP 5.2.6
Windows2000 Professional (5.0 Build 2195 Platform 2 Service Pack 4)
for a detailed overview I attach a JTS log

Any help is appreciated
Thanks in advance for your help!

Dirk

Diagnostic Information
Joomla! Version: Joomla! 1.5.4 Production/Stable [ Naiki ] 6-July-2008 22:00 GMT
configuration.php: Writable (Mode: 666 ) | RG_EMULATION: N/A
Architecture/Platform: Windows NT 5.0 ( i586) | Web Server: Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h mod_autoindex_color PHP/5.2.6 ( localhost ) | PHP Version: 5.2.6
PHP Requirements: register_globals: Disabled | magic_quotes_gpc: Enabled | safe_mode: Disabled | MySQL Support: Yes | XML Support: Yes | zlib Support: Yes
mbstring Support (1.5): Yes | iconv Support (1.5): Yes | save.session_path: Writable | Max.Execution Time: 60 seconds | File Uploads: Enabled
MySQL Version: 5.0.51b-community-nt ( [...] via TCP/IP )

Extended Information:
SEF: Disabled (without ReWrite) | FTP Layer: Enabled | htaccess: Not Implemented
PHP/suExec: User and Web Server accounts are not the same. (PHP/suExec probably not installed)
PHP Environment: API: apache2handler | MySQLi: Yes | Max. Memory: 32M | Max. Upload Size: 32M | Max. Post Size: 16M | Max. Input Time: 60 | Zend Version: 2.2.0
Disabled Functions:
MySQL Client: 5.0.51b ( latin1 )

Re: Error: Call to undefined Method

Posted: 11 Jul 2008, 20:20
by Jan
Hi the problem is that Phoca Gallery uses external method to clean the xhtml code from some attacks (e.g. xss attack) because of not correctly working clean method in Joomla... So I don't know what can be the problem on here ... :( maybe some files are missed in the installation (do you have the last version of Phoca Guestbook?) :(

Jan

[Updated]: Error - only in latest Joomla 1.5.4?

Posted: 11 Jul 2008, 20:38
by DerRuhri
Thx for the fast response!

Yes, phoca guestbook is 1.3 .0beta and Joomla is 1.5.4
The funny thing is that an old phoca version (I think 1.2.2)
works without problems on Joomla 1.5.1 on the live website..

So old on old works, latest on latest on test installation does not.

If I find the time over the weekend, I will check wether an
'older' phoca version works on Joomla 1.5.4 and let you know.

[Added Sat , July 12]
  • Live Website: Joomla 1.5.1 - Guestbook 1.2.2 - works fine
    Test Site: Joomla 1.5.4 - Guestbook 1.3.0 - errror
    Test Site: Joomla 1.5.4 - Guestbook 1.2.2 - errror
    Unfortunately, unlike your site, afaik Joomla doesn't keep
    record of their older versions so I can't run out of the box
    Joomla 1.5.1 - Guestbook 1.3.0, which should be interesting.
Given my very limited knowledge in php, please excuse my wild guessing:
As the function 'tokenizeHTML' which calls domdocument::loadHTML() and then
throws the error has not been changed between guestbook 1.2.2 and 1.3.0,

Code: Select all

        $doc = new DOMDocument();
        $doc->encoding = 'UTF-8'; // theoretically, the above has this covered
        
        set_error_handler(array($this, 'muteErrorHandler'));
        $doc->loadHTML($html);
  • - either domdocument::loadHTML() has been changed between 1.5.1 and 1.5.4
    which I doubt pretty much - too basic
    - or I'm not seeing something really stupid in my test scenario :oops:
I really like your components and the swift support (had three smaller issues before
which I could solve by simply reading other posts), but here I'm at the end of my wits.
Staying on Joomla1.5.1 and phoca1.2.2 solves it for now, but is not an option for good.
Again, any ideas welcome :wink:

Dirk

Re: Error: Call to undefined Method

Posted: 13 Jul 2008, 00:52
by DerRuhri
Hmm ..even if I put in in a fresh 1.5.4, nothing else but the Guest Book installed,
I get this error - no matter wether I install the sample data or not.

jos_phocaguestbook_books and jos_phocaguestbook_items were created ok

In the back end everything looks ok, in the front end it doesn't.

Even after I imported the items and guestbooks from an existing installation via
SQL script - in the backend o.k., but I can't link it in the front end.

Always these two errors
Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in
..\components\com_phocaguestbook\assets\library\HTMLPurifier\Lexer\DOMLex.php on line 58

Fatal error: Call to undefined method domdocument::loadHTML() in
..\components\com_phocaguestbook\assets\library\HTMLPurifier\Lexer\DOMLex.php on line 62
Weird.

Re: Error: Call to undefined Method

Posted: 13 Jul 2008, 21:28
by Jan
The funny thing is that an old phoca version (I think 1.2.2)
works without problems on Joomla 1.5.1 on the live website..

So old on old works, latest on latest on test installation does not.
Not funny :( , it works but without protection... the problem code is a HTML purifier code using in Phoca Guestbook, but version 1.2.2 doesn't use this method. It works (v1.2.2) but there is no protection e.g. against XSS attacks... :(

Jan

Re: Error: Call to undefined Method

Posted: 26 Feb 2009, 04:40
by vfx
i got the same error with latest version of Guestbook 1.3.2

Re: Error: Call to undefined Method

Posted: 26 Feb 2009, 04:47
by vfx
i found a fix via this linkhttp://forums.bambooinvoice.org/index.p ... hread/317/

If you're using xampp, go to apache/bin/php.ini and comment out:

extension=php_domxml.dll and extension=php_pdf.dll

Re: Error: Call to undefined Method

Posted: 27 Feb 2009, 21:41
by Jan
Ok