Problem:
------------------------------
The following warnings are generated in a freshly installed Drupal 5.7 site with only DBFM (+dependencies) added:
# warning: Cannot modify header information - headers already sent by (output started at C:\bin\portable_xampp\htdocs\bare-drupal-5.7\sites\all\modules\contrib\dbfm\dbfm.module:1002) in C:\bin\portable_xampp\htdocs\bare-drupal-5.7\includes\common.inc on line 141.
Happens when clicking on the Administer >> Site Configuration menu link.
The code at line 1002 is
echo drupal_to_js($var);
, with the whole function being:
function dbfm_json($var = NULL) {
// We are returning JavaScript, so tell the browser.
drupal_set_header('Content-Type: text/javascript; charset=utf-8');
if (isset($var)) {
echo drupal_to_js($var);
}
}
Fix(?):
------------------------------
A logical fix seemed:
function dbfm_json($var = NULL) {
if (isset($var)) {
// We are returning JavaScript, so tell the browser.
drupal_set_header('Content-Type: text/javascript; charset=utf-8');
echo drupal_to_js($var);
}
}
, which did fix the problem but I've only been looking at DBFM for the past 3 hours so perhaps someone who is a higher authority on the DBFM source code should confirm and commit it?
Comments
Comment #1
rooey commentedThanks for that! We'll look into it.
In the mean time, version 5.x.3.0 was released yesterday - take a look!
Comment #2
rooey commentedComment #3
rooey commentedComment #4
rooey commentedComment #5
rooey commented