cmscritic Posted October 1, 2014 Share Posted October 1, 2014 I've got an issue where my RSS feed is not validating due to some tags but I can't figure out what files to alter in order to correct it. See http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.cmscritic.com%2Ffeed%2F Link to comment Share on other sites More sharing options...
netcarver Posted October 1, 2014 Share Posted October 1, 2014 @cmscritic, The message I'm seeing there says "Error has been logged." What are you seeing in your error log? Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 @cmscritic, The message I'm seeing there says "Error has been logged." What are you seeing in your error log? Try again. I reinstalled the module to see if that would help. It's now showing the issue Link to comment Share on other sites More sharing options...
netcarver Posted October 1, 2014 Share Posted October 1, 2014 (edited) Ok, I can't tell you which file to edit; I simply don't know but I have seen problems like this in the past and they were either due to byte-order-marks* that were being saved by someone's editor as it wrote out the a PHP file or some whitespace at the beginning or end of a PHP file that is being output as part of the feed where it isn't valid to have it in XML. I can't guarantee that either of these are the problem in your case but then again, perhaps they are. Anyway, here are some clues as to what to do to find out... Grep your PW installation - particularly modules and your own templates - for "?>" near the end of files. If there is HTML following the "?>" then it is needed - if there is only what appears to be whitespace remove the ?> to the end of the file and save the file. Sometimes people put ?> at the end of their PHP files and don't realise that *any* whitespace following the ?> tag will be output verbatim as part of the output stream by PHP. Re-save each suspect file from an editor that you can configure to save as utf-8 and not to save with the Byte-order-mark. (Notepad++ on Windows is one good candidate.) * Covers one troublesome aspect of BOMs. The other is that if they appear at the start of your PHP file, before the "<?php" then even though they might be correctly handled by your code editor, PHP can emit them as part of the output stream as it appears before the start of PHP interpretation. If the PHP file is building a feed then the invisible BOM is emitted straight into your XML - probably invalidating it. Anyway, that's the mental model I had of this when I ran across something pretty similar to this a few years ago and managed to fix it - I might be wrong though - in which case I await correction with anticipation. Edited October 1, 2014 by netcarver Edited to add link to article and a little more background. Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 Thanks for the suggestion but I think the key is this line, which needs to somehow be altered.: This feed does not validate. line 103, column 2: XML parsing error: <unknown>:103:2: not well-formed (invalid token) [help] </div><!--/#content--> ^ 1 Link to comment Share on other sites More sharing options...
netcarver Posted October 1, 2014 Share Posted October 1, 2014 Hah, have to laugh at myself as there is a more probable cause which I totally overlooked and you even opened your topic with it! Ignore the above diatribe - it's only applicable if the tags are being closed right - which I now see is the point you were making. I'll leave the embarrassing reply above as it might help someone else out one day. In the meantime, I'll swing back to my tree to consider a suitable penance for being obtuse. 1 Link to comment Share on other sites More sharing options...
netcarver Posted October 1, 2014 Share Posted October 1, 2014 Err, dare I creep down and suggest searching your installed files for "<!--/#content-->"? /netcarver shoots back up to safety. Link to comment Share on other sites More sharing options...
kongondo Posted October 1, 2014 Share Posted October 1, 2014 What module is this? RSS Feed Generator? Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 It's ryan's core module Markup RSS I can see where the problem is (a </div> ) and it appears to be in my _main.php but I can't seem to figure out how to get around it as it needs to be there. Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 Err, dare I creep down and suggest searching your installed files for "<!--/#content-->"? /netcarver shoots back up to safety. Found that in my main_php and since I use CodeAnywhere.com I can see it's not impressed with the placement of the </div> but it's needed so I'm not sure how to fix it. Link to comment Share on other sites More sharing options...
horst Posted October 1, 2014 Share Posted October 1, 2014 Where is the opening div? Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 Where is the opening div? Even more bizarre is my footer is now doubling up for some reason on the site, if you look here: http://www.cmscritic.com Link to comment Share on other sites More sharing options...
netcarver Posted October 1, 2014 Share Posted October 1, 2014 Hmm. Not only have I been obtuse today but my eyes are now playing tricks on me as I've downloaded your pastebin file so I can search it locally and I can't find the line your editor is highlighting as a problem in the pastebin version at all. In the image you posted above you are doing an include of a footer file followed by output of a HTML5 footer - so perhaps that explains why you were seeing a double footer on the site (which I can't see from here at the moment BTW.) Anyway, I see your feed is validating so I'm guessing this is now fixed. Please let us know! Link to comment Share on other sites More sharing options...
cmscritic Posted October 1, 2014 Author Share Posted October 1, 2014 Ryan just fixed things up so we are good now. Thanks all for your help. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now