Bug 761 - [Chameleon-Widget]Cannot download a map image with Print widget
: [Chameleon-Widget]Cannot download a map image with Print widget
Status: CLOSED FIXED
: Chameleon
Widget
: 1.99
: PC Linux
: P2 normal
: 1.99 beta 3
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-10-24 19:54 by
Modified: 2004-11-08 11:10 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-10-24 19:54:52
It is not possible to download a map image with the Print widget.  Some PHP
errors are output instead (see below).


Fedora Core 2
Chameleon beta 3 20041022



-----------------
PHP errors:

[24-Oct-2004 19:46:54] PHP Notice:  Undefined variable:  file_name in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 151
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 160
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 161
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 163
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 164
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 165
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 166
[24-Oct-2004 19:46:54] PHP Warning:  Cannot modify header information - headers
already sent by (output started at
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml:151) in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 167
------- Comment #1 From 2004-10-25 07:30:24 -------
This is likely happening because you have "display_errors" set in your php.ini
(just a guess).  If php starts any type of text output (like a notice or
warning), then it is not possible for it to start outputting a file stream.

Can you confirm that your php.ini "display_error" entry is set to "On"? 
------- Comment #2 From 2004-10-25 08:36:43 -------
Yes you are right for my settings.  But nevertheless the error should not come
out.
------- Comment #3 From 2004-10-25 09:19:32 -------
Changed target to 1.99 Beta 3.
------- Comment #4 From 2004-10-25 11:19:45 -------
Unfortunately it is a legacy thing that certain aspects of Chameleon require the
display of errors to be turned off.  I believe it is a requirement of Chameleon
set "display_errors" to off.

That being said, I agree that this is a pain and should be dealt with.  I would
propose to close this bug and add a new enhancement to remove this dependancy. 
As it is all new widgest are hopefully being developed with this in mind.
------- Comment #5 From 2004-10-25 11:40:15 -------
To clarify, what I meant to say was that I think we should open a new bug as an
enhancent for the ENTIRE Chameleon application to be looked at to remove this
dependancy.
------- Comment #6 From 2004-10-25 12:47:33 -------
Makes sense to open a bug for the dependancy.  But to make myself clear too,
when I set the "display_error" to off.  It works, the map image is downloaded. 
But if I look in errors log produced by PHP I saw the following error:

[25-Oct-2004 08:34:25] PHP Notice:  Undefined variable:  file_name in
/home/nsavard/proj/chameleon_beta/htdocs/widgets/download.phtml on line 151
------- Comment #7 From 2004-10-25 13:21:23 -------
actually there is a bug here ... the code on line 137 tests $szFileName but
later (line 148 and line 151) refer incorrectly to $file_name.  I've committed
the changes, I think this should fix the problem.

For the record, Chameleon is supposed to work cleanly with Notices turned on and
we should all be testing that way.  Note that MS4W comes with notices turned off
by default because some of the older apps have not been cleaned up.

For production use of Chameleon, we should be recommending to turn off
display_errors and use log_errors instead.
------- Comment #8 From 2004-11-01 16:27:02 -------
Paul this has not been fixed in beta 3 20041101.

This was tested on windows by doing the following steps:
* loading app http://localhost/chameleon/samples/sample_enhanced.phtml
* zooming into an area of canada.
* selecting the Print Map button.
* in the PrintMap popup selected the download button.
* in the popup I get the following error.

http://localhost//ms_tmp/4186a4c27ed6a.png
Warning: Cannot modify header information - headers already sent by (output
started at D:\ms4w\apps\chameleon\htdocs\widgets\download.phtml:167) in
D:\ms4w\apps\chameleon\htdocs\widgets\download.phtml on line 212

------- Comment #9 From 2004-11-01 19:40:30 -------
there was an extra 'echo' that was causing the download to fail in this
particular case.  Fixed in cvs.
------- Comment #10 From 2004-11-07 15:28:42 -------
able to preview and download print map for windows using beta 3 20041105 
------- Comment #11 From 2004-11-08 11:10:52 -------
Verified on Fedora Core 2.