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

Home » FUDforum Development » Bug Reports » very terrible bug
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon8.gif  very terrible bug [message #5947] Sat, 28 September 2002 02:38 Go to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
I just edited header.tmml template using template management menu as following:

----------start here------------
<html>
<head>
<title>{GVAR: FORUM_TITLE}{VAR: TITLE_EXTRA}</title>
{META-CONTENT-LANGUAGE}
<script language="javascript" src="lib.js" type="text/javascript"></script>
<link rel="StyleSheet" href="{THEME_ROOT}/forum.css" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td bgcolor="#73B5DE">
<img src="/images/logo.gif">
</td></tr></table>
<table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td class="ForumBackground">
--------end here --------------------

and it worked just fine. I was able to see the image on the top of the URL.
BUT !!!!!
Now new users can't register themselves. When they click on the "Agree" button, the following error appears on the screen:

FATAL ERROR: inconsistent number of values inside a select

I removed my change - no result.
I reinstalled everything from scratch - it worked again, but when I repeated the editing - I got the same error, so I'm sure the error is related to the header.tmpl change.


icon5.gif  Re: very terrible bug [message #5950 is a reply to message #5947] Sat, 28 September 2002 11:59 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
Ok, I did some investigations and I probably know what causes the problem.
All those files, that have long strings (longer then 1024 char).
I replaced the /theme/default/register.php file with the original one and it works again. However I found at least one more thing, that still is corrupted. If I login as root, under Global Configuration Menu, the last line I can see is:
Server Time Zone ...
I just looked at the code, restored the "include/theme/default/tz.inc" file and it started to work again.

Here is my question:

Is it possible to avoid all these files or just split long strings?
Many applications can't handle them, at least under Solaris OS.
Re: very terrible bug [message #5952 is a reply to message #5950] Sat, 28 September 2002 14:20 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Which version of the forum are you using? As far as I can tell length of strings should not matter in this case, could you show me the version of header.tmpl that caused your forum to encounter problems. Thanks.

FUDforum Core Developer
Re: very terrible bug [message #5968 is a reply to message #5950] Sun, 29 September 2002 00:16 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
Here is the header:
/************************************************************************** *
* copyright : (C) 2001,2002 Advanced Internet Designs Inc.
* email : forum(at)prohost(dot)org
*
* $Id: header.tmpl,v 1.5 2002/08/05 05:58:21 hackie Exp $
*************************************************************************** *

and here are the system info:

System Configuration
PHP built On: SunOS dmz 5.8 Generic_108528-16 sun4u sparc SUNW,UltraAX-i2
MySQL Version: 3.23.48
PHP Version: 4.2.3
Web Server: Apache/1.3.26 (Unix) mod_perl/1.27 mod_ssl/2.8.10 OpenSSL/0.9.6g mod_fastcgi/2.2.10 PHP/4.2.3
WebServer to PHP interface: apache
Forum Version: 2.3.1
Relavent PHP Settings: Safe Mode: OFF
Display Errors: OFF
File Uploads: ON
Magic Quotes: ON
Register Globals: OFF
Output Buffering: OFF
Disabled Functions: none
PSpell Support: No




As far as I understand, the problem is not in the header.tmpl file, but when I submit changed for it using the web interface - there're many other files from ./theme/default and ./include/theme/default are being changed.
Re: very terrible bug [message #5971 is a reply to message #5968] Sun, 29 September 2002 00:41 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Uhm nope, I wanted to see the entire file not just the header.
That does nothing for me.


FUDforum Core Developer
Re: very terrible bug [message #5973 is a reply to message #5968] Sun, 29 September 2002 00:55 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
Ok, here it is:
-----------------start------------------------
/************************************************************************** *
* copyright : (C) 2001,2002 Advanced Internet Designs Inc.
* email : forum(at)prohost(dot)org
*
* $Id: header.tmpl,v 1.5 2002/08/05 05:58:21 hackie Exp $
*************************************************************************** *

*************************************************************************** *
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*************************************************************************** /

{MAIN_SECTION: header forum page header}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>{GVAR: FORUM_TITLE}{VAR: TITLE_EXTRA}</title>
{META-CONTENT-LANGUAGE}
<script language="javascript" src="lib.js" type="text/javascript"></script>
<link rel="StyleSheet" href="{THEME_ROOT}/forum.css" type="text/css">
</head>
<body>

<table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td bgcolor="
#73B5DE">
<img src="/images/logo.gif">
</td></tr></table>

<table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td class="ForumBackground">
{MAIN_SECTION: END}

{MAIN_SECTION: header_plain header for small popup forms}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
{META-CONTENT-LANGUAGE}
<title>{GVAR: FORUM_TITLE}{VAR: TITLE_EXTRA}</title>
<BASE HREF="{GVAR: WWW_ROOT}">
<script language="JavaScript" src="lib.js" type="text/javascript"></script>
<link rel="StyleSheet" href="{THEME_ROOT}/forum.css" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td class="Fo
rumBackground">
{MAIN_SECTION: END}
------------------------end---------------------------
but I'm sure there're many other files are being changed while the header.tmpl submit.
BTW.,what is the difference between these 2 options:

» header -> forum page header
» header_plain -> header for small popup forms

on the URL/adm/tmpllist.php?... It's under "Template editor".
Thanks.



Re: very terrible bug [message #5976 is a reply to message #5973] Sun, 29 September 2002 14:49 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Many compiled files get affected, this is because header is inlined into virtually every single compiled file.

FUDforum Core Developer
Re: very terrible bug [message #5979 is a reply to message #5976] Sun, 29 September 2002 16:20 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
prottoss wrote on Sun, 29 September 2002 10:49

Many compiled files get affected, this is because header is inlined into virtually every single compiled file.


I understand, but some of them got broken:
./theme/default/register.php and
./include/theme/default/tz.inc
these ones that includes long strings.
When I restored these two files from the backup and edited them manually everything worked fine.
Re: very terrible bug [message #5993 is a reply to message #5979] Mon, 30 September 2002 15:56 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Cannot replicate this bug, I've created the header identical to the one you've made using the template editor and had not encountered any problems on register page, while registering a user.
Did you perphaps make modification to some other files, especially source files? From the looks of it seems like you may have edited the tz.inc.t file incorrectly and when it was compiled you got the error.


FUDforum Core Developer
Re: very terrible bug [message #5995 is a reply to message #5993] Mon, 30 September 2002 18:35 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
The problem also happens when I'm changing footer.tmpl file.
Both changes I did using the web interface.

I think there're some Solaris restrictions with long strings. For example, I found out, that solaris "fgets" function is restricted with 256 bytes. I tested it with the following code:

#include <stdio.h>
int main(int argc,char **argv) {
char line[8192];
while((fgets(line,8192,stdin)) != EOF) {
printf("The line is '%s'\n",line);
}
}

Another symtom, I wasn't able to edit the above files with vi editor on Solaris, but was able on linux... There're restrictions for solaris "sed" and "awk" utilities. I'm quite sure there're some PHP functions, that also are restricted.
This actually is the reason I asked you for avoiding the long strings.
Alternatively, is it possible to use apache "include" function. You should add something like :
<!--#include file="header.tmpl"-->
in html document and activate "Includes" options for the directory in apache configuration file. In this case there's no need to edit all the files.

Thanks.
Re: very terrible bug [message #6001 is a reply to message #5995] Mon, 30 September 2002 19:26 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
As you probably know fgets() does not guarantee to read 8192 bytes, it'll stop if it encounters a \n or any other line end character as defined by Solaris' libc library.
To be honest this is the first time I hear of this limitation on Solaris.
Then again I am not big Solaris expert so I dunno.

FUDforum does not however use fgets of fputs() it uses fread() and fwrite(), which write the entire chunk to disk so this should not be a problem. Since php would buffer the writes as need be until the entire file is written to disk.

Doing <!--#include file="header.tmpl"--> is not correct for multitude of reasons, if you are already using PHP you should use PHP's own include() or require() or even readfile() to include files. This also adds dependency on apache includes being allowed an enabled.


FUDforum Core Developer
Re: very terrible bug [message #6012 is a reply to message #6001] Mon, 30 September 2002 20:11 Go to previous messageGo to next message
artur4 is currently offline  artur4   United States
Messages: 20
Registered: September 2002
Karma: 0
Junior Member
I'm not going to discuss solaris with you, but
somehow the problem disappered in the new 2.3.2RC3 version ..
Re: very terrible bug [message #6014 is a reply to message #6012] Mon, 30 September 2002 20:14 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, that's a plus Wink

Hopefuly it'll continue working properly.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Error when i try create new thread
Next Topic: import forum data problem
Goto Forum:
  

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

Current Time: Tue Nov 26 18:34:42 GMT 2024

Total time taken to generate the page: 0.03095 seconds