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

Home » FUDforum Development » Bug Reports » Issues with compacting messages
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Issues with compacting messages [message #158310] Tue, 17 February 2009 14:42 Go to next message
JanRei is currently offline  JanRei   
Messages: 361
Registered: October 2005
Location: Germany
Karma: 0
Senior Member
Contributing Core Developer
Translator
Using FUDforum built from latest CVS compacting messages sometimes fail, because the message file can't be removed. I don't know the reason yet since it seems to work sometimes. In case of failure the page is automatically forced to be scrolled down (probably by JavaScript) so I can't scroll it up, which is a bit annoying.

On the page is shown;
Quote:
Disabling the forum for the duration of maintenance run

Please wait while forum is being compacted.
This may take a while depending on the size of your forum.
Compacting normal messages...
FATAL ERROR: unable to remove file F:/xampp/htdocs/FUDforum/messages/msg_10000


In the error log appears:
Quote:
PHP Warning: unlink(F:/xampp/htdocs/FUDforum/messages/msg_10000) [<a href='function.unlink'>function.unlink</a>]: Permission denied in F:\xampp\htdocs\forum\adm\compact.php on line 186
Re: Issues with compacting messages [message #158311 is a reply to message #158310] Tue, 17 February 2009 15:11 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
This is one of those funny Windows errors (Linux works just fine). Possible solutions are discussed at http://www.php.net/unlink
Re: Issues with compacting messages [message #158313 is a reply to message #158310] Tue, 17 February 2009 15:23 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
Thank you, I will have look. Can you do something about the scrolling issue?
Re: Issues with compacting messages [message #158314 is a reply to message #158313] Tue, 17 February 2009 15:30 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
I'll have a look at it later tonight.
Re: Issues with compacting messages [message #158329 is a reply to message #158314] Wed, 18 February 2009 09:05 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
Here is your patch to stop JavaScript scrolling once an error is encountered: http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=11871
Re: Issues with compacting messages [message #158361 is a reply to message #158329] Fri, 20 February 2009 14:59 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
And here is a patch to make the script work on Windows: http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=11872
Re: Issues with compacting messages [message #158459 is a reply to message #158310] Thu, 26 February 2009 12:27 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
The situation is definitely better with the patches. Sometimes the page gets scrolled down although there is actually no reason for it (the output is only a few lines long), but I can scroll it up again without problems.

On a freshly installed forum I get the following error message. There error seems to occur because there are no private messages yet, so it's most likely not a big issue but I want to note it.

Quote:
An error was generated in file F:\xampp\htdocs\forum\adm\compact.php on line 260.

The error message was: unlink(F:/xampp/htdocs/FUDforum/messages/private) [function.unlink]: No such file or directory
Re: Issues with compacting messages [message #158461 is a reply to message #158459] Thu, 26 February 2009 12:48 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
Yes, you can safely ignore this error. Once your first PM is created, you will never see it again.
Re: Issues with compacting messages [message #158499 is a reply to message #158310] Fri, 27 February 2009 16:37 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
What do you think about a small modification to the error handler so that it doesn't trigger on supressed error messages?

--- F:/xampp/htdocs/forum/adm/compact_orig.php	Thu Feb 26 12:44:46 2009
+++ F:/xampp/htdocs/forum/adm/compact.php	Thu Feb 26 18:41:48 2009
@@ -96,12 +96,16 @@
 set_error_handler ('error_handler');
 
 function error_handler ($level, $message, $file, $line, $context) {
-	echo <<<_END_
+	if (error_reporting() != 0) {
+		echo <<<_END_
 <script type="text/javascript">clearInterval(intervalID);</script>
 <p>An error was generated in file $file on line $line.</p>
 <p><font color="red">The error message was: $message</font></p>
 _END_;
-	exit;
+		exit;
+	} else {
+		return;
+	}
 } 
 
 function write_body_c($data, &$len, &$offset, $fid)
Re: Issues with compacting messages [message #158501 is a reply to message #158499] Fri, 27 February 2009 17:09 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
Looks good! I think you just solved this problem.
Re: Issues with compacting messages [message #158523 is a reply to message #158501] Sun, 01 March 2009 18:08 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Patch applied. Thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: maillist.php from 2.8, 2.8RC problem
Next Topic: maillist import from html to utf-8 incorrect
Goto Forum:
  

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

Current Time: Fri Nov 22 05:01:16 GMT 2024

Total time taken to generate the page: 0.03965 seconds