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

Bug in Sapphire controller class?


Go to End


4 Posts   668 Views

Avatar
BenWu

Community Member, 97 Posts

12 April 2012 at 11:30pm

Hello,

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

Ben

Avatar
Willr

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:
http://www.silverstripe.org/general-questions/show/16359#post301479

Avatar
BenWu

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

cms/templates/PageCommentInterface.ss

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.

regards,
Ben

Avatar
Willr

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/PageCommentInterface.ss 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.