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

Error using $PageComments


Go to End


6 Posts   1950 Views

Avatar
franz1982

Community Member, 1 Post

15 May 2011 at 5:27am

I'm a SilverStripe beginner following the Tutorial 2 (http://doc.silverstripe.org/sapphire/en/tutorials/2-extending-a-basic-site). I find an error when trying to include comments on a page (the news page in the tutorial):

This page contains the following errors:
error on line 171 at column 101: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.

The error disappear when $PageComments is removed from the .ss file:

<% include Menu2 %>
<div id="Content" class="typography">
            <% include Breadcrumbs %>
    <h1>$Title</h1>
    $Content
    <div class="newsDetails">
        Posted on $Date.Nice by $Author
    </div>
    $PageComments
</div>

Any help?
Thanks!

Avatar
Willr

Forum Moderator, 5523 Posts

15 May 2011 at 12:27pm

It sounds like an XML error. You can either use plain xhtml over text rather than XML by removing the xml header at the top of Page.ss *or* you should be able to make this change - http://open.silverstripe.org/ticket/6610 manually to your installation.

Avatar
mrcl

Community Member, 8 Posts

24 April 2012 at 3:03pm

Edited: 24/04/2012 3:06pm

This bug fix does not work for me...

Adding .ATT do $DeleteAllLink simply makes the Delete stop working!!! Then when it is clicked it goes back to Home.

Is there anything else that could be done?
It would be nice to get it sorted.

Cheers

Avatar
mrcl

Community Member, 8 Posts

24 April 2012 at 3:17pm

I had a look and the problem seems to be that $DeleteAllLink generates a & character for the request.
When publishing anything using the CMS, I noticed that this character (&) screws up the Text Field String to be processed.
So probably there might be something to be done when generating the string itself, considering this special character.
That should be carried out at the CMS Text Fields as well.

Does some one noticed this sort of problem?

Avatar
Willr

Forum Moderator, 5523 Posts

24 April 2012 at 3:56pm

Adding .ATT do $DeleteAllLink simply makes the Delete stop working!!! Then when it is clicked it goes back to Home.

Are you sure you don't have a javascript error on the page? What HTML does it generate in the template (or is it blank?)

Avatar
mrcl

Community Member, 8 Posts

24 April 2012 at 4:14pm

It generates a link to HOME...
I am just following the Tutorial 2 and then ended up with this issue. So ther is no extra java script on the top of what standard SilverStirpe Framework does.
Reading the link you have posted it seems that the guys who were trying that same solution got the same kind of issue...

At the top of my head nothing come to help me think about a java script issue.

Regarding what the CMS does, maybe while saving text with special character (e.g. &) it could not treat it right. But this is still standard SS.

Following all Tutorial 2 steps, till $PageComments, seems to give this same error for other users... (http://www.silverstripe.org/general-questions/show/19064#post313511)
But I am just a newbie in SS, so if you have anything to help us, that would be nice....

Cheers