error in ezpublish:Call to undefined method eZDOMDocument

Author Message

Yannick Komotir

Monday 15 September 2008 7:22:52 am

hi,
i am working when i see the following error when i want to create an objet(node)

Fatal error: Call to undefined method eZDOMDocument::saveXML() in C:\...\kernel\classes\datatypes\ezxmltext\ezxmltexttype.php on line 307
Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended, the debug output is present below.

i never have modify any file in kernel, it appear when i want to create an objet by front as well by back office, i just remember that it occur after i had add an extension (redirect operators) and modify an a relation objet's attribute.

I have clear cache, delete the extension and replace the database to an old, nothing chages the error persist !

can you help me ?

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Kalen Emhof

Monday 15 September 2008 8:41:58 am

I have the same problem also. Only I'm on CentOS 5.2.

I have two installations of 4.0.1 on this machine. One of them works just fine. The problematic installation has that same error, and the installation was copied from another machine, and had the same error on that machine also.

So machine A is running ezpublish 4.0.1 and has that error

Machine B is running ezpublish 4.0.0 and has that error.

Error message

Fatal error: Call to undefined method eZDOMDocument::saveXML() in kernel/classes/datatypes/ezxmltext/ezxmltexttype.php on line 307
Fatal error: eZ Publish did not finish its request

Google reveals this website: http://www.frefred.fr/blog/migration_sous_ez_4_0
But i can't read french, and google translate isn't perfect so I have no clue what the solution might be.

Yannick Komotir

Monday 15 September 2008 8:56:32 am

hi Kalen Emhof,

me too i read the link which don't resolve this problem

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Yannick Komotir

Tuesday 16 September 2008 2:55:47 am

It's the method who generate problem, you have an idea ?

/*!
     \static
     \return the XML structure in \a $domDocument as text. It will take of care of the necessary charset conversions  for content storage.
    */
    static function domString( $domDocument )
    {
        return $domDocument->saveXML();
    }
 

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

André R.

Tuesday 16 September 2008 3:23:43 am

Make sure you haven't enabled the domxml extension(the one we used on php4 in eZ Publish 3.x), only the standard php xml extension should be enabled. On Redhat / Fedora / CentOs, you have to enable it specifically your self.

Read more here:
http://ez.no/developer/forum/install_configuration/4_0_time_zone_error_during_install/re_4_0_time_zone_error_during_install__11

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marco Caldari

Thursday 25 September 2008 11:35:19 am

Hello,
We are experiencing the same problem migrating from 3.10.1 to 4.0.1,
our enviroment on Debian

EZP 4.0.1 SVN: 19785
Estensioni: shuffle , ezdhtml , ezfind , ezpaypal

PHP Versione: 5.2.6-0.dotdeb.1
Estensioni: zip, xmlwriter, libxml, dom, xmlreader, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, pcre, SimpleXML, sockets, soap, SPL, shmop, standard, Reflection, posix, mime_magic, mbstring, json, iconv, hash, gettext, ftp, filter, exif, dbase, dba, date, ctype, calendar, bz2, bcmath, zlib, openssl, apache2handler, eAccelerator, gd, mysql, mysqli, PDO, pdo_mysql

Apache Versione: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 PHP/5.2.6-0.dotdeb.1 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.5(2006-08-25) mod_ssl/2.2.3 OpenSSL/0.9.8c

Everything works fine but as we try to create a new object we receive:

<b>Fatal error: Call to undefined method eZDOMDocument::saveXML() in ../kernel/classes/datatypes/ezxmltext/ezxmltexttype.php on line 307
Fatal error: eZ Publish did not finish its request</b>

Can anyone help me resolve this problem?
Thanks in advance for Your help,
Marco

André R.

Thursday 25 September 2008 12:25:09 pm

If you read the post above yours, you'll see something about domxml aka dom extension should not be used with php 5.x.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Yannick Komotir

Friday 26 September 2008 1:44:35 am

Thank to you Andre R. for your answers, I solved my problem by copying the file var, settings and extension into a new ezpublish installation!

i never know the really reason of this error in my case!

Full thank's

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Marco Caldari

Friday 26 September 2008 6:38:03 am

Thanks for Your Help,
The problem seems not in the php5 dom extension, as long as we know, in php5 everything is embedded in the core,

In fact if we make a fresh Ez4.0.1 installation on the same machine everything works smooth.. so it should be a problem in the system update from 3.10.1 to 4.0.1,

We repeated step by step the upgrade and we found this issue,
Finished installing ezfind we have to run the updatesearchindexsolr.php to index content and we get an error similar to one posted on a forum thread named <b>php-cli probleme</b>.

Till this point all works fine apart ezfind of course, following the thread quoted above we try this command;

<b>bin/php/ezpgenerateautoloads.php -extension</b>

After this the system become slow and in the admin interface as I try to create a new object i get the error on topic of this thread,

Now.. We need ezfind, once you try it.. you can't do without, and ezfind seems stable on our enviroment with 3.10.1,

Do we stop there or we risk to update every site to 4.0.1 hoping that ezfind for ez4 series will be fixed in the next future?

Any further help is very appreciated,
Thank You,
Marco

Gaetano Giunta

Friday 26 September 2008 9:08:00 am

"Thanks for Your Help,
The problem seems not in the php5 dom extension, as long as we know, in php5 everything is embedded in the core..."

The problem is a bit more subtle:
- php 5 DOM extension is good, and enabled by default in php5
- php4 DOMXML extension is bad, and disabled by default in php5...

...BUT, if DOMXML is enabled in php5, it silently takes the place of DOM. And you end up with an DOMDocument class has "almost" the same api, but misses the saveXML() method.

There is no other logical explanation for that error message, so be reassured that if you see it appearing, you have surely found the cause for your problems.

About running php cli scripts: remember that the ini file used by php in cli mode is generally not the same as the one used when running php as an apache module. So you might have domxml loaded in cli but not in apache or viceversa

Principal Consultant International Business
Member of the Community Project Board

Denis Zatsarinny

Thursday 16 October 2008 11:52:15 pm

Hi!

May be this patch can help?

Original
---------------------------------------------------------------------------------------------------------------------------
/*!
\static
\return the XML structure in \a $domDocument as text. It will take of care of the necessary charset conversions for content storage.
*/
static function domString( $domDocument )
{
return $domDocument->saveXML();
}
---------------------------------------------------------------------------------------------------------------------------
Replace

---------------------------------------------------------------------------------------------------------------------------
/*!
\static
\return the XML structure in \a $domDocument as text.
It will take of care of the necessary charset conversions
for content storage.
*/
static function domString( $domDocument )
{
if(is_object($domDocument) && method_exists($domDocument,'saveXML'))
return $domDocument->saveXML();
else
return "";
}

---------------------------------------------------------------------------------------------------------------------------

Kristof Coomans

Friday 17 October 2008 12:56:41 am

Hi

Since eZ Publish 4 all datatypes make use of the PHP 5 native DOM functions, and not any longer from the ones provided by eZ Publish' own non-standard DOM library (eZDOMDocument and friends). It seems like you've ended up in a mixed environment, where certain classes are still using eZDOMDocument instead of DOMDocument. Can you tell us, do you have any WYSIWYG editor extensions enabled that plug into the XML text datatype, which might not be compatible with eZ Publish 4 yet? Also check if your eZ Publish installation got modified, with setup/systemupgrade. Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Genri Moshkovich

Monday 20 October 2008 10:19:28 am

Kristof is absolutely right!
If you are updating your eZ installation from eZ 3.x to eZ 4.x please check that all extensions using old DOM functions are removed from system.

In my case, we updated our system to eZ 4.0.1 but left old ezdhtml editor from eZ 3.10.
We tried to turn it of in extensions section and regenerate autoloads using "renerate autoloads" button.
But it didn't help. Than I take a look at /autoload/ezp_extension.php and noticed that
'advDOMDocument' => 'extension/ezdhtml/lib/advdomnode.php',
'advDOMNode' => 'extension/ezdhtml/lib/advdomnode.php',
'eZDHTMLInputParser' => 'extension/ezdhtml/ezxmltext/handlers/input/ezdhtmlinputparser.php',
'eZDHTMLXMLInput' => 'extension/ezdhtml/ezxmltext/handlers/input/ezdhtmlxmlinput.php',
'eZXMLInputParser' => 'extension/ezdhtml/ezxmltext/common/ezxmlinputparser.php',
'eZXMLSchema' => 'extension/ezdhtml/ezxmltext/common/ezxmlschema.php',
still were there, so I needed to remove them manuallly.

So please make sure that you removed them from autoloads. And use a new OE editor instead of old eZ 3.x version editor.

Best regards,
Genri Moshkovich

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.