FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Warnings in tree view (Warnings when one presses a message iin a tree view of the topic)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Warnings in tree view [message #160784] Fri, 23 October 2009 17:00 Go to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
In FUDforum 3.0.0 RC2 when pressing a message link in a tree view in the bottom of the topic I see the warnings:

Warning: file_get_contents(/site/FUDforum/thm/default/i18n/russian/charset) [function.file-get-contents]: failed to open stream: No such file or directory in /site/forum/theme/default/tree_msg.php on line 602

Warning: Cannot modify header information - headers already sent by (output started at /site/forum/theme/default/tree_msg.php:602) in /site/forum/theme/default/tree_msg.php on line 607
Re: Warnings in tree view [message #160785 is a reply to message #160784] Fri, 23 October 2009 19:14 Go to previous messageGo to next message
JanRei is currently offline  JanRei   
Messages: 361
Registered: October 2005
Location: Germany
Karma: 0
Senior Member
Contributing Core Developer
Translator
It seems there is a problem with the detection of the character set. I attached a patch that should improve this, it also requires rebuilding of the theme.
Re: Warnings in tree view [message #160787 is a reply to message #160785] Fri, 23 October 2009 19:52 Go to previous messageGo to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Thank you. The warnings disappeared.
Re: Warnings in tree view [message #160789 is a reply to message #160787] Sat, 24 October 2009 07:08 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Thanks for the effort so far, but further work is needed before this patch can be committed. CHARSET is not expanded in this context:

$ grep '{CHAR' *                                                                                                                               
tree_msg.php:   header('Content-Type: text/html; charset={CHARSET}');
Re: Warnings in tree view [message #160804 is a reply to message #160784] Sat, 24 October 2009 14:35 Go to previous messageGo to next message
JanRei is currently offline  JanRei   
Messages: 361
Registered: October 2005
Location: Germany
Karma: 0
Senior Member
Contributing Core Developer
Translator
Sorry, fairly silly mistake. I attached an updated patch. However, it seems that tree_msg.php is basically the only place where we send charset information via HTTP headers. Maybe we should move this somewhere into index.php?

UPDATE: I additionally attached a patch for root_index.php.t to include content-type and charset headers.

[Updated on: Sat, 24 October 2009 19:54]

Report message to a moderator

Re: Warnings in tree view [message #160805 is a reply to message #160804] Sat, 24 October 2009 14:55 Go to previous messageGo to next message
gorm is currently offline  gorm
Messages: 29
Registered: October 2009
Location: Moscow, Russia
Karma: 0
Junior Member
Thank you, this now indeed corrects the problem. Because the initial corrections while removing the warnings in Firefox made IE to generate errors.
Re: Warnings in tree view [message #160815 is a reply to message #160804] Sun, 25 October 2009 08:10 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
JanRei wrote on Sat, 24 October 2009 16:35
However, it seems that tree_msg.php is basically the only place where we send charset information via HTTP headers.


errmsg.inc.t has similar code.

Not sure why, but {forum_CHARSET} isn't expanded either. Possibly a problem in compiler.inc.
Re: Warnings in tree view [message #160822 is a reply to message #160784] Sun, 25 October 2009 17:13 Go to previous messageGo to next message
JanRei is currently offline  JanRei   
Messages: 361
Registered: October 2005
Location: Germany
Karma: 0
Senior Member
Contributing Core Developer
Translator
{TEMPLATE: forum_CHARSET} should work in case there is a corresponding section in the template. In both patches it is expanded to utf-8 for me.

So do you think that makes sense to send those headers in index.php? Maybe we could put it in the beginng of the file so that they are sent before errmsg.inc is called. Then we should be able to drop this code from errmsg.inc.t.
Re: Warnings in tree view [message #160824 is a reply to message #160822] Sun, 25 October 2009 19:15 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
JanRei het op So, 25 Oktober 2009 19:13 geskryf:
{TEMPLATE: forum_CHARSET} should work in case there is a corresponding section in the template. In both patches it is expanded to utf-8 for me.


You are right, I did something funny. Your patch works and the code is expanded as expected.

JanRei het op So, 25 Oktober 2009 19:13 geskryf:
So do you think that makes sense to send those headers in index.php? Maybe we could put it in the beginning of the file so that they are sent before errmsg.inc is called. Then we should be able to drop this code from errmsg.inc.t.


It would be easier to use a {TEMPLATE: forum_CHARSET} in errmsg.inc.t. However, I have no problem if you want to move the header to index.php. Just ensure that it doesn't break anything like XML feeds, PDF docs, file downloads, etc.
Re: Warnings in tree view [message #160825 is a reply to message #160824] Sun, 25 October 2009 20:12 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
First patch was applied: http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=12066
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Encoding UTF-8.ru validation failed
Next Topic: Cannot save settings for Notify moderator(s) of all new messages
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 11:01:36 GMT 2024

Total time taken to generate the page: 0.03334 seconds