Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

XML-Errors: Sitemaps & RSS-Feeds not working after update

edited January 2015 in Vanilla 2.0 - 2.8

Hey Community,

I installed XML-Sitemaps before Vanilla V.2.1.8 released, and it worked well. I updated to 2.1.8. a few days ago. Now I noticed that the XML files seems to be not generated correctly.

It seems that there's something missing in the XML-File, because this is the error I get:

XML Parse Error: XML or text declaration not at start of entity

This is the source code of a feed.rss:

#
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
      <title>English - Community</title>
      <link>http://community.link-removed.com/index.php?p=/categories/general/feed.rss</link>
      <pubDate>Tue, 27 Jan 2015 11:00:43 +0000</pubDate>
         <description>English - Community</description>
   <language>en-CA</language>
   <atom:link href="http://community.link-removed.com/index.php?p=/categories/general/feed.rss" rel="self" type="application/rss+xml" />
   </channel>
</rss>
#

Does anyone know if it's correct that the first line is commented out?

Best regards!

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Does it validate?

    http://validator.w3.org/

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    Hey,

    no, it gives me this:
    **
    Validation Output: 1 Error**

    Error Line 1, Column 9: XML declaration allowed only at the start of the document
    
        <?xml version="1.0" encoding="utf-8"?>
    
  • Options

    I can not understand this error, isn't the declaration the following line?

    <?xml version="1.0" encoding="utf-8"?>

    It's already at the start of the document....

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Mind sharing a link so I can look at it?

    This sounds like a plugin is outputting whitespace before the xml declaration.

    What kind of plugins are you running?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    Yes, indeed! You can look at it here: community.deutsche-phytoengineering.de

    There are 4 space characters before the xml declaration begins.

    I have some plugins, but the error occurs even if I just deactivate them..

  • Options
    hgtonighthgtonight ∞ · New Moderator

    If it still doesn't work with all plugins disabled and on the default theme, what is in your /applications/dashboard/views/rss.master.php file?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    edited January 2015

    That's the content:

    <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
    
    <rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom">
        <channel>
          <title><?php echo $this->Head->Title(); ?></title>
          <link><?php echo htmlspecialchars(Url('', TRUE, TRUE)); ?></link>
          <pubDate><?php echo date('r'); ?></pubDate>
          <?php
             $this->RenderAsset('RssHead');
    
             /* Sample RSS Content:
             <item>
                <title>Atom-Powered Robots Run Amok</title>
                <link>http://example.org/2003/12/13/atom03</link>
                <guid isPermaLink="false">urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</guid>
                <pubDate>Sat, 13 Dec 2003 18:30:02 GMT</pubDate>
                <description>Some text.</description>
             </item>
             */
             $this->RenderAsset('Content');
          ?>
       </channel>
    </rss>
    

    If it still helps: The Sitemap-Plugin generates XML-Files with the same error as you can see here:
    http://community.deutsche-phytoengineering.de/index.php?p=/sitemapindex.xml

  • Options

    https://www.dokuwiki.org/tips:findbadphp.php
    Or directly download it:
    https://www.dokuwiki.org/_export/code/tips:findbadphp.php?codeblock=0

    Copy this into your root folder as a .php file, call it from your browser and report back what you get.

  • Options

    okay! I just did it.

    starting...
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/authentication/configure.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/entry/auth/handshake.php is not readable.
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/modules/trace.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/profile/username.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/statistics/configuration.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/statistics/disabled.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/statistics/tick.php is not readable.
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/statistics/verify.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/utility/blank.php is not readable.
    /homepages/10/d88744470/htdocs/dpe_community/applications/dashboard/views/utility/sprites.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/conf/bootstrap.after.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/plugins/ButtonBar/views/buttonbar.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/plugins/Sitemaps/views/showfile.php is not readable.
    /homepages/10/d88744470/htdocs/dpe_community/plugins/FileUpload/views/attach_file.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/plugins/FileUpload/views/blank.php is not readable.
    /homepages/10/d88744470/htdocs/dpe_community/plugins/FileUpload/views/link_files.php doesn't start with <?php
    /homepages/10/d88744470/htdocs/dpe_community/plugins/FileUpload/views/toggle.php doesn't start with <?php
    finished...
    
  • Options
    BleistivtBleistivt Moderator
    edited January 2015
    /homepages/10/d88744470/htdocs/dpe_community/conf/bootstrap.after.php doesn't start with <?php
    

    Check for whitespace at the start of this file. It could also be a UTF-8 BOM, in which case you have to resave the file without a byte order mark

  • Options

    Yeeeeeh! THe bootstrap.after.php contains the 4 whitespaces.
    How did you know...

    Thank you so much!

  • Options

    hey guys can anybody help me with a similar error, i am new to this so i need baby steps :)
    i am running vanilla 2.1.11 using the cube theme by steam based on bootstrap. i have disabled all plugins and tried to check /applications/dashboard/views/rss.master.php but the file is listed as other file not a php. i haven't tried Bleistivts suggestion as i don't know where my root folder is.
    help a newbie learn fellas & thanks in Advance.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @VapeNinja said:
    hey guys can anybody help me with a similar error, i am new to this so i need baby steps :)
    i am running vanilla 2.1.11 using the cube theme by steam based on bootstrap. i have disabled all plugins and tried to check /applications/dashboard/views/rss.master.php but the file is listed as other file not a php. i haven't tried Bleistivts suggestion as i don't know where my root folder is.

    Where and how did you upload the Vanilla files? where the index.php file is and the "applications", "cache", "conf", etc. folders are, that's where you have to put the file bleistivt mentioned

  • Options

    thanks for replying @R_J i have installed it on a heartinternet server following vanilla instructions, i will add the file now and update you with my progress.

  • Options
    VapeNinjaVapeNinja New
    edited June 2015

    seems to be very different from the code from the forum above.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Sorry, sometimes I answer without reading the question :blush:

    What is your problem exactly? Your first screenshot looks good. It shows the XML that forms a discussion feed.

  • Options

    Looking back I didn't even say, so my fault.
    My RSS feed button when clicked brings up the XML error. I have used the findbad.php and the image attached above is the results
    I also have another niggle with the mobile mode looking a mess but I guess I should start a separate thread for that :)

  • Options

    Just removing the first line...

    <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>

    ...validated my feed. Is this problematic?

  • Options

    @Simeon_Griggs said:
    Just removing the first line...

    <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>

    ...validated my feed. Is this problematic?

    If you have whitespace errors you should find them. It is more of a problem than just the feed. Removing the encoding isn't a good idea.

    grep is your friend.

Sign In or Register to comment.