Skip to main content
Topic: Always same error in logs (Read 2233 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Always same error in logs

Hello,

I see always those error in logs:



Code: [Select]
==>520:		return number_format($number, (float) $number === $number ? ($override_decimal_count === false ? $decimal_count : $override_decimal_count) : 0, $decimal_separator, $thousands_separator);



My Tailor is rich

Re: Always same error in logs

Reply #1

That is a terribly weird one.
Does it happen only with that specific URL (https://forum.mpdb.tv/index.php?https://forum.mpdb.tv/) or with other URLs as well?
Bugs creator.
Features destroyer.
Template killer.

Re: Always same error in logs

Reply #2

Sometimes it happens at this address:    

https://forum.mpdb.tv/index.php?
Code: [Select]
Fichier: /home/shaitan/www/forum/sources/Subs.php
Ligne: 520

But most of the time it's the other address

If your need Admin access, files access, no problem.

 

My Tailor is rich

Re: Always same error in logs

Reply #3

AHA!
Little nasty bug! :P
And anyway it's a SimplePortal bug, so...
 emanuele blames @Spuds  O:-)

Simple fix is to change in sources/subs/PortalBlocks.subs.php:
Code: [Select]
		$totals += array(
'average_members' => comma_format(round($averages['registers'] / $total_days_up, 2)),
'average_posts' => comma_format(round($averages['posts'] / $total_days_up, 2)),
'average_topics' => comma_format(round($averages['topics'] / $total_days_up, 2)),
'average_online' => comma_format(round($averages['most_on'] / $total_days_up, 2)),
);
to:
Code: [Select]
		$totals += array(
'average_members' => round($averages['registers'] / $total_days_up, 2),
'average_posts' => round($averages['posts'] / $total_days_up, 2),
'average_topics' => round($averages['topics'] / $total_days_up, 2),
'average_online' => round($averages['most_on'] / $total_days_up, 2),
);

Mostly unrelated: @Spuds do you think it would be hard to add the whole stack trace of functions (the function/class names should be mostly enough) to the error log?
The current one was designed to work with the monolithic structure of SMF with no more than two to five nested function calls, and I feel that the more we add functions, the more difficult is to track down where the actual problem is. :-\
Bugs creator.
Features destroyer.
Template killer.

Re: Always same error in logs

Reply #4

Why is comma_format causing a problem?

No idea what would be involved in adding additional trace info to the error.log.  Makes sense to add it, just not sure what is needed!

Re: Always same error in logs

Reply #5

Because it's applied twice: there and few lines below when the numbers are echo'ed.
Bugs creator.
Features destroyer.
Template killer.

Re: Always same error in logs

Reply #6

Ah ha ... I think comma_format should be smart enough to handle my sloppy coding !

Re: Always same error in logs

Reply #7

Beautiful, threre are no more errors in my logs !

Many thanks !




 
My Tailor is rich

 

Re: Always same error in logs

Reply #8

You know how strict is php when it comes to accepting data types! LOL
Bugs creator.
Features destroyer.
Template killer.