At the end of the rsvp_csv_hash_form() function it runs drupal_goto(). The problem is that depending on site / server configuration it may not work correctly and transmit the file to download. Also, strictly speaking it shouldn't work, given that drupal_goto() uses the header() function with a HTTP location path which generally won't want to run after data has been output. Finally, given that the CVS paths are loaded from links from other pages, is there a need to do a redirect at all, why not just let it exit the function normally?

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new482 bytes

Here's a patch that removes the drupal_goto() call so that all downloads will complete correctly and leave visitors at the page they're already viewing.

damienmckenna’s picture

StatusFileSize
new493 bytes

As it turns out, without the drupal_goto() it then proceeded to execute return $form; which had the effect of appending a full Drupal page to the CSV data. Here's a patch that simply runs exit() at the end of the function to ensure no additional output is added.