Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DOMDocument::saveHTML() failure after latest 3.1 pull


Go to End


3 Posts   1741 Views

Avatar
tazzydemon

Community Member, 135 Posts

20 February 2013 at 10:58am

Edited: 20/02/2013 11:32am

Guys,

I've posted to trac about this as well but I have just pulled 3.1 which by the looks of it will have 3.1 beta 2 merged in it. I now have a serious failure due, I believe, to my php version which is 5.3.3, the Centos standard release.

[Warning] DOMDocument::saveHTML() expects exactly 0 parameters, 1 given

Line 529 of ShortcodeParser.php :

529: foreach($html->childNodes as $child) $res .= $doc->saveHTML($child);

Research suggests that this does not work less than php 5.3.6. See http://www.php.net/manual/en/domdocument.savehtml.php You may wish to revisit version requirements or alter code as

Many users such as me cannot easily go beyond 5.3.3 so this is an issue.

Avatar
tazzydemon

Community Member, 135 Posts

20 February 2013 at 1:42pm

Simple fix for now: revert to the old ShortcodeParser file (I dont use shortcodes anyway)

Avatar
tazzydemon

Community Member, 135 Posts

26 February 2013 at 9:13am

Edited: 26/02/2013 9:25am

It has been pointed out by DirtyHam that 3.1.0 beta 2 works with 5.3.3.

A quick glance shows that 3.1 and 3.1 beta are quite different in this file. The offending php method is still present in 3.1 but not the beta.

The functions loadHTML() and saveHTML() are added in 3.1. There's a few other differences too. The offender is saveHTML(). The will not work sub php 5.3.6.

Assuming this is acceptable and deliberate then it should be added that to requirements. I am at present building a copy of my main centos server so I can add the remi repository to it and test upgrading php to (up to) 5.4.x.

This is available for centos 5x and 6x