I have added a track field to a content type as well as an associated map field and graph field. The Google map works well and displays the track. However, the graph is not displayed. It seems that JpGraph does not generate anygraph. That Drupal is hosted on Anhosting.com.
Do you have an idea why the graph is not generated?
Thanks, Jm
Comments
Comment #1
Giuseppe commentedProbably, there's a patch for that problem: http://drupal.org/node/395666.
Comment #2
jmseigneur commentedThanks to point out that patch although it didn't work in my case because it sends headers before everything has been processed and headers are then modified, which creates a warning saying that headers have already been sent.
After commenting the following in trackfield_graph.inc, the graphs are shown on my side.
Anhosting replied quickly. I didn't ask them to try to solve the apache_setenv('no-gzip', '1') issue.
PS: I commented the following
/* Return 'Not Modified' if we can - Apache only
$request = getallheaders();
if (isset($request['If-Modified-Since'])) {
/* Remove information after the semicolon and form a timestamp */
/*
$request_modified = explode(';', $request['If-Modified-Since']);
$request_modified = strtotime($request_modified[0]);
if (isset($modified) && $modified <= $request_modified) {*/
/*
* If we don't put cache-control and such on this then 304
* is only sent once and the browser cache cleared, causing
* the next load to return the whole image.
*/
/* header('Content-Type: image/png');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $modified) . ' GMT');
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $expires_offset) .' GMT');
header('Cache-Control: public, must-revalidate, max-age=0');
header('HTTP/1.1 304 Not Modified');
exit();
}
}*/
/*
* We're going to have to return an image now.
* Tell Apache not to compress it again.
*/
//apache_setenv('no-gzip', '1');
Comment #3
raintonr commentedHi, instead of commenting out this block can you please wrap it with an if?
if (function_exists('apache_setenv')) {...}As I said, only have Apache so cannot test if this function is missing on other platforms, but seems likely it will be.
If that works I can go ahead and commit such a change.
Comment #4
raintonr commentedActually... closing as a dupe of #395666: function getallheaders() not defined in trackfield_graph.inc