Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: LiBen on February 07, 2021, 11:05:15 PM

Title: Re: Error Log is filed with numeric value errors
Post by: LiBen on February 07, 2021, 11:05:15 PM
Just went from:
SMF 2.0.17 to 2.0.18
PHP 7.3 to 7.4.15

At the same time I took a look at the following problem:
When members went to action=profile;area=statistics
Following error would occur:
8: A non well formed numeric value encountered
File: .../Themes/default/Profile.template.php
Line: 1105

The solution of Demidrin worked.

Quote from: Demidrin on June 21, 2017, 01:27:18 PM
Alright, it seems at least at my template there is a bug for default number format using commas in decimal numbers?

The current situation (line numbers may differ):
Profile.template.php (line 1099)

<div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">



I fixed this template part like this (using now the correct value for the calculation part):
Profile.template.php (line 1099)


<div class="profile_pie" style="background-position: -', ((int) ($activity['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">



Maybe somebody can check if this is a general problem in the default template?

BR

I check the default install for SMF 2.0.18 and it has the same error.
Title: Re: Re: Error Log is filed with numeric value errors
Post by: Aleksi "Lex" Kilpinen on February 20, 2021, 01:56:41 PM
Just to make sure, you were able to replicate this on a clean 2.0.18 install? That would sound like a bug to me. Could you confirm this is the case, and we could move this to the bug reports board.
Title: Re: Error Log is filed with numeric value errors
Post by: Kindred on February 20, 2021, 03:58:53 PM
I can nto replicate this... and the reference to a PIE chart implies a mod to me, since all of the charts on the default page are bar graphs...

just checked.... profile_pie is not a class in the default product
Title: Re: Re: Error Log is filed with numeric value errors
Post by: Aleksi "Lex" Kilpinen on February 20, 2021, 04:07:37 PM
Thanks Kindred. Since the issue includes a solution, and this doesn't seem to fall in to bug category - Marking solved then.