GetSimple Support Forum
Caching_functions Error - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Caching_functions Error (/showthread.php?tid=5785)



Caching_functions Error - pchulpleusden - 2014-03-15

Hey all.

I'm using GetSimple now for several years and I find it really easy to use. But when I wanted to upgrade my version of GetSimple (3.0) to the newest 3.3.1, I experienced some problems. There were some issues with the caching methods namely the following error:
Quote:Warning: SimpleXMLElement::addChild(): unterminated entity reference -restaurant in /home/wa/domains/wa.nl/public_html/admin/inc/caching_functions.php on line 286

After some searching on the internet I found out that the addChild method had some problems were it wouldn't escape the characters: http://stackoverflow.com/a/17028414. So after changing the line 286 from:
PHP Code:
$pages->addChild('url'$id); 
To the following lines:
PHP Code:
$pages->addChild('url');
$pages->url $id

Maybe it can help someone else or maybe it can be implemented in the core code.[/php]


RE: Caching_functions Error - shawn_a - 2014-03-16

are you using simplexmlextended ?
show your code, what were you adding ? Whats the string ?

oh i see now, this is php and addchild issue
very odd

but you say this changed after upgrading? I dont recall changing anything in there.


https://github.com/GetSimpleCMS/GetSimpleCMS/issues/782


RE: Caching_functions Error - pchulpleusden - 2014-03-16

This is purely the GetSimple core (3.3.1) and the only changes I made are the above. So what do you want me to show exactly?


RE: Caching_functions Error - shawn_a - 2014-03-16

Do you know how to reproduce, you have a slug or something with a & in it ?

I just realized you upgraded from 3.0, so yeah there is no telling what changed there.
Ill probably fix this in 3.3.2 soon, Ii can't imagine it breaking anything.


RE: Caching_functions Error - pchulpleusden - 2014-03-16

Probably it has something to do with special chars indeed. I probably have some slug with special chars in it, because the website is partly Asian.

It's no problem for me anymore, but I thought maybe I can help someone else with it.

The Stackoverflow link also is pointing to the special chars, because of it not escaping: http://www.php.net/manual/en/simplexmlelement.addchild.php#112204. By the way, there were also some problems with the template_functions.php file, were the same error had come up. But I unfortunately forgot to note the line numbers, but I think it's some where between line 1000 and 1200 where the sitemap is created. Hopefully it helps a bit.

By the way I must say I also changed servers (and PHP-versions), so maybe it has something to do with that as well. The old version was PHP 5.3.8 and the new version is PHP 5.3.17.


RE: Caching_functions Error - shawn_a - 2014-03-18

I think I found the problem here.

Page cache contains the url twice, one not as cdata.

Code:
    <item>
        <url>admin-1</url>
        <pubDate><![CDATA[Wed, 12 Mar 2014 12:53:04 -0500]]></pubDate>
        <title><![CDATA[admin]]></title>
        <url><![CDATA[admin-1]]></url>
        <meta><![CDATA[]]></meta>
        <metad><![CDATA[]]></metad>
        <menu><![CDATA[admin]]></menu>
        <menuStatus><![CDATA[]]></menuStatus>
        <template><![CDATA[template.php]]></template>
        <parent><![CDATA[]]></parent>
        <private><![CDATA[]]></private>
        <author><![CDATA[user]]></author>
        <creDate><![CDATA[Wed, 12 Mar 2014 12:52:54 -0500]]></creDate>
        <user><![CDATA[user]]></user>
        <menuOrder><![CDATA[1]]></menuOrder>
        <slug><![CDATA[admin-1]]></slug>
        <filename><![CDATA[admin-1.xml]]></filename>
    </item>

Now to figure out is this is new, or when it was introduced.


RE: Caching_functions Error - shawn_a - 2014-03-18

new issue replaced this one

https://github.com/GetSimpleCMS/GetSimpleCMS/issues/784

I imagine this should fix the issue, or rather make it invalid.


RE: Caching_functions Error - Carlos - 2014-03-18

(2014-03-18, 00:43:59)shawn_a Wrote: Now to figure out is this is new, or when it was introduced.

:-o
Not new, since 3.1
This commit:
https://github.com/GetSimpleCMS/GetSimpleCMS/commit/c06267b8eee2b1fbe9358ceba6ea1ad070eb9827#diff-a7f177ee630011de4ee8200ba8c43b6e