Problem/Motivation

aggregator_page_opml() and aggregator_page_rss() are having HTML appended to their output due to the way the theme and callback systems works.

Proposed resolution

With the development of WSSCI there should be a way to prevent callbacks/controllers from being wrapped up in the theme layer. Failing that, the original proposed solution is to print the results and use drupal exit. @see #1987390-66: aggregator.module - Convert theme_ functions to Twig

Remaining tasks

  • Write a patch that will produce the correct results for both aggregator_page_rss() and aggregator_page_opml() callbacks.
  • Write tests to confirm that the correct results are on the page and that there is no further HTML being rendered.
  • Backport to 7.x

#1987390: aggregator.module - Convert theme_ functions to Twig

Original report by @drupalninja99

#1987390-31: aggregator.module - Convert theme_ functions to Twig

Comments

drupalninja99’s picture

I had originally looked at the XML RPC module for a comp and I see there that they just do this

function xmlrpc_server_output($xml) {
  $xml = '<?xml version="1.0"?>' . "\n" . $xml;
  drupal_add_http_header('Content-Length', strlen($xml));
  drupal_add_http_header('Content-Type', 'text/xml');
  echo $xml;
  drupal_exit();
}

Which doesn't seem like a best practice way of doing things. so initially I had added the same thing for aggregator, i.e. print theme('...'); drupal_exit(); to print only the RSS XML, not the HTML output from the Drupal theme. Is there not a clean way to do this in Drupal 8?

joelpittet’s picture

Status: Active » Closed (duplicate)

Closing this as a duplicate based on #1963544: Convert aggregator/rss to views

joelpittet’s picture

Issue summary: View changes

Remove updated bit