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

Home » FUDforum Development » Bug Reports » Issues with compacting messages
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Issues with compacting messages [message #158310] Tue, 17 February 2009 09: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
add to buddy list
ignore all messages by this user
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 10:11 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 10: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
add to buddy list
ignore all messages by this user
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 10:30 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 04:05 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 09:59 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 07: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
add to buddy list
ignore all messages by this user
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 07:48 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 11: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
add to buddy list
ignore all messages by this user
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 12:09 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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 13:08 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Patch applied. Thanks.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Thu Dec 14 05:19:15 EST 2017

Total time taken to generate the page: 0.00786 seconds