I think I have found a bug in Nodestream RSS. When I activate the module and uses the default view to show rss promos I get two line breaks in the beginning of the file which means that it's not useable for RSS-readers.

I use format "Rss feed - fields" in views. It doesn't add the line breaks at the preview in views but in the real XML-file.

I have looked in the views_rss and ns_prod_rss but I don't find where the xml-file is produced.



<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="XXX" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nyheter från XXX</title>
<description>XX</description>
<link>XXX</link>
<atom:link rel="self" href="XX" />
<pubDate>Thu, 26 Apr 2012 08:22:44 +0200</pubDate>
<lastBuildDate>Thu, 26 Apr 2012 08:22:44 +0200</lastBuildDate>
    <item>
  <title>XXX</title>
<link>XXXX</link>
<description> XXXXX </description>
<pubDate>2012-04-26 08:22</pubDate>
<source url="XXX">Nyheter från XXX</source>
</item>
  </channel>
</rss>

Comments

fabsor’s picture

Project: NodeStream » NodeStream RSS
Version: 7.x-2.0-alpha13 » 7.x-2.x-dev

Moving to the NodeStream RSS project.

bobodrone’s picture

I can not reproduce this bug.

There is a discussion in a related Views issue found here: http://drupal.org/node/1275042.

Most likely some other module causes this. Try to do a search for CR before the <?php in your current module/theme directory and see if you can find the problem.

b.r
/ Bobodrone

bobodrone’s picture

Status: Active » Needs review

If you add the line

print $module . '|';

to the function 'module_load_all' in the file /includes/module.inc you will enforce a line break in the output of the modules list. The first module on the second line will start with a CR.

I've now added a CR just for test in the ns_prod_rss module and when using the print statment from below it will show the output at the top of the page (as well as an error saying that header already been sent!):
dblog|overlay|rules|devel|strongarm|block|apps|cache_actions|comment|contextual|crossclone|ctools|dblog|defaultconfig|devel_generate|diff|draggableviews|dynamic_formatters|email|entity|entitycache|entityreference|entity_token|field|field_sql_storage|field_ui|file|file_entity|filter|help|image|libraries|list|locale|media|media_internet|menu|menu_block|node|ns_article|ns_contributor|ns_core|ns_media|ns_prod_news| ns_prod_rss|ns_prod_search|ns_roles|ns_styles|number|options|overlay|panels|panels_everywhere|panels_ipe|panels_mini|panels_ref_formatter|pathologic|references_dialog|rules_admin|search|selenium|simpletest|system|taxonomy|taxonomy_menu_form|text|token|toolbar|update|user|uuid|views_content|views_rss|views_rss_core|views_ui|field_group|views|features|rules|panelizer|devel|page_manager|nodestream|

Here is the function that you could change for getting the output above:

function module_load_all($bootstrap = FALSE) {
  static $has_run = FALSE;

  if (isset($bootstrap)) {
    foreach (module_list(TRUE, $bootstrap) as $module) {
      drupal_load('module', $module);
      print $module.'|';
    }
    // $has_run will be TRUE if $bootstrap is FALSE.
    $has_run = !$bootstrap;
  }
  return $has_run;
}

Read more here: http://drupal.org/node/175137

Note that you could have a blank line in other places as well; index.php? theme files?

janfang’s picture

Status: Needs review » Fixed

I found the error, it was in template.php in my theme. The problem is discribed here: http://drupal.org/node/175137#comment-5444978 "The template might also be an issue. In my case there were trailing spaces at the end of sites/all/themes/BRANDNAME/template.php."

Thank you for your help! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Inserted code-tag