Jump to:

23375 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » Bug in Sapphire controller class?

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

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

Page: 1
Go to End
Author Topic: 270 Views
  • BenWu
    Avatar
    Community Member
    87 Posts

    Bug in Sapphire controller class? Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Bug in Sapphire controller class? Link to this post

    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

  • BenWu
    Avatar
    Community Member
    87 Posts

    Re: Bug in Sapphire controller class? Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Bug in Sapphire controller class? Link to this post

    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.

    270 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.