Load Error! (parse error) Loading Sitemap

Permalink
Hi,
anyone seen this on a 5.7.4 install?

I upgraded a 5.7.4 rc1 instance to 5.7.4 and wherever the sitemap is supposed to show instead of the sitemap rendering I get a red exclamation mark and the above message.

I just tried a fresh install with another download of 5.7.4 and I get the same. I'm guessing it is environment related.

Anyone seen this before, can point me in the right direction and save me some time?

 
WebcentricLtd replied on at Permalink Reply
Just realised there is a bug in the tracker for this.
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi AndyJ,

The bug was quickly fixed by mlocati.
https://github.com/concrete5/concrete5-5.7.0/pull/2398...

You can apply the fix by replacing these two files:
concrete/src/File/Service/File.php
concrete/src/Legacy/Controller/ToolController.php

concrete/src/File/Service/File.php
https://raw.githubusercontent.com/concrete5/concrete5-5.7.0/c1b45098...

concrete/src/Legacy/Controller/ToolController.php
https://raw.githubusercontent.com/concrete5/concrete5-5.7.0/c1b45098...
WebcentricLtd replied on at Permalink Reply
brilliant stuff - you've saved me some time there. I was about to go the wrong way on this.
tambopc replied on at Permalink Reply
tambopc
I got the same error when I updated from 5.7.3.1 to 5.7.4 jist now. Replaced File.php and ToolControler.php and all fixed now. A very big thank you for your forum and the people who contribute
tambopc replied on at Permalink Reply
tambopc
Sorry for the bad spelling
LatFarry replied on at Permalink Reply
I have this problem and followed your steps, but unfortunately the problem persists. Could you advise me any further. Many thanks in advance.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@LatFarry

Instead of applying this fix to an older version of concrete5, I recommended updating to the current version which includes the fix (along with many other fixes and improvements).
LatFarry replied on at Permalink Reply
Than you for the reply, I have the very latest version of Concrete5 it is a new install only about a week old. Everything was ok at the start but then this error occured.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@LatFarry

Can you trace the error back to a certain event or narrow down the time frame?

What actions have you performed over the last week? Did you change themes, modify a theme, install a package, etc.?
LatFarry replied on at Permalink Reply
Yes I installed Avenir 5.7, and a few basic blocks, just new site design stuff really, nothing major.
maddox replied on at Permalink Reply 1 Attachment
maddox
Hey there... I was going crazy trying to find out why I could not get my sitemap to work all I was getting was the dreaded "Load error! (parserror)" message instead of the site map.
(C5 v5.7.4.2 and C5 v5.7.5)

It turns out that though tedious back-tracing and un-installing I narrowed it down to the add-on responsible for my troubles. If you happen to have the add-on named "ACCESSIBILITY PER USER" (See image attached) then you have to make sure to UNINSTALL IT and check the remove it from (whatever) option. Clear the cache and it should work. Hope that helps.
webigear replied on at Permalink Reply
webigear
Thanks this helped out. Automatic Email Obstructor was causing same issue on 5.7.5.9
maddox replied on at Permalink Reply
maddox
Glad you got things working and thanks for the heads up with the add-on that is causing problems as well.
All the best!
justynpride replied on at Permalink Reply
I'm currently getting this error on a clean concrete 5.7.5.9 install with no adds on themes installed. Any thoughts?
shoutmediaca replied on at Permalink Reply
shoutmediaca
I don't have a solution but possibly can shed a little light on this. I am also getting this error on a clean install of 5.7.5.8. It seems to be caused by my attempt to add a header item in a package I have installed. In the package's controller in its on_start() function, I have the following code
$v = View::getInstance();
$pkg = parent::getByHandle($this->pkgHandle);
$pkgPath = $pkg->getRelativePath();
$v->addHeaderItem('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=[API_KEY]&libraries=places"></script>');

It works and adds the script to the head but it also causes the Sitemap error. If I take out the addHeaderItem, the Sitemap works again.

So, I can stop the error but can't get my package to work properly then. I'm guessing there is another way to add a header item to a package that won't cause sitemap issues but I'm not aware of it. Anyone out there know a way around this?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@KorkolaDesign

I believe addHeaderItem() in your package on_start() adds items to all pages - theme pages and concrete5 dashboard pages. Your Google API script is being added everywhere, which I don't believe you are looking to do.

Where are you trying to load this script?

If you are looking to load this within a block, it could be done using $this->addHeaderItem() in view(), edit(), and add(), depending on what you are trying to accomplish.

If you are looking to load this within a single page/dashboard single page, it can be done using $this->addHeaderItem() in a controller method like view() or methods you have created.
shoutmediaca replied on at Permalink Reply
shoutmediaca
MrKDilkington. Thanks for your response. You are exactly right. I have found another resolution as well that might be helpful to other users out there. I put the following code in the block controller that works well.
public function registerViewAssets($outputContent = '')
    {
        $this->addFooterItem(
            '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={API_KEY}&libraries=places"></script>'
        );
    }


I wasn't aware of the registerViewAssets() function that could be used for things like this.