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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

Bug in Sapphire controller class?

Go to End

4 Posts   535 Views


Community Member, 97 Posts

12 April 2012 at 11:30pm


One of my sites got page comment turned on but firefox throws up an error:

XML Paring Error: not well-formed
Location: ...
Line Number ....

<p id='DelteComments'><a href='http://localhost/PageComment/delteallcomments?pageid=1&SecurittyID=12312318234jdshsfds'>

I traced it up and find this is caused by the static function join_links()

at this file sapphire/core/control/Controller.php

I therefore have to add 2 lines before
return $result;

$result = str_replace('&amp;', '&', $result);
$result = str_replace('&', '&amp;', $result);

Am I doing the right thing? As I am a new user (just a couple of days) of SS and I am not sure it is a bug and should report this via the right channel



Forum Moderator, 5523 Posts

13 April 2012 at 7:10pm

It is a bug in the comments area which should be fixed (just a matter of updating the link function in template to use $DeleteAllLink.ATT rather than $DeleteAllLink

You can also not use strict XML:


Community Member, 97 Posts

13 April 2012 at 11:40pm

Edited: 13/04/2012 11:40pm

Many Thanks Will.

I don't think I can change the template either because the template file is at


I therefore think the Core controller should be fixed as the link it generates is not well-xml formated, and that's the ROOT reason.

I guess for now I either fix the bug myself in the Controller or use non-strict XML.



Forum Moderator, 5523 Posts

14 April 2012 at 10:32am

You can override any templates in your theme. This is one of the great things about SS. So if you want to edit a 'core' template i.e ms/templates/ just copy that file to yourtheme/templates folder and you can alter as you want. You don't want to escape content from random parts all over the place as you'll end up in instances of double encoding.