Advertisement:

Author Topic: User statistics - A non well formed numeric value encountered  (Read 403 times)

Offline iso

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
    • station23
User statistics - A non well formed numeric value encountered
« on: February 16, 2019, 10:11:55 PM »
Hi,

if I access the user statistic (also of a newly created user) I get this error:

Code: [Select]
Error
Art des Fehlers: General
Fehlermeldung: 8: A non well formed numeric value encountered
File: /var/www/web127/htdocs/foobar/forum/Themes/default/Profile.template.php
Line: 1410
URL der Seite die den Fehler erzeugte: https://foobar-users.de/index.php?action=profile;area=statistics;u=2349
Backtrace information
#0: smf_error_handler()
Called from /var/www/web127/htdocs/foobar/forum/Themes/default/Profile.template.php on line 1410
#1: template_statPanel()
Called from /var/www/web127/htdocs/foobar/forum/Sources/Load.php on line 2463
#2: loadSubTemplate()
Called from /var/www/web127/htdocs/foobar/forum/Sources/Subs.php on line 3279
#3: obExit()
Called from /var/www/web127/htdocs/foobar/forum/index.php on line 154

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 616
Re: User statistics - A non well formed numeric value encountered
« Reply #1 on: February 17, 2019, 01:12:55 AM »
Can you please run this query give us the feedback of the return:
Code: [Select]
SELECT
b.id_board, MAX(b.name) AS name, b.num_posts, COUNT(*) AS message_count,
CASE WHEN COUNT(*) > MAX(b.num_posts) THEN 1 ELSE COUNT(*) / MAX(b.num_posts) END * 100 AS percentage
FROM smf_messages AS m
INNER JOIN smf_boards AS b ON (b.id_board = m.id_board)
WHERE m.id_member = 2349
GROUP BY b.id_board, b.num_posts
ORDER BY percentage DESC
LIMIT 10
« Last Edit: February 17, 2019, 01:23:50 AM by albertlast »

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 616
Re: User statistics - A non well formed numeric value encountered
« Reply #2 on: February 17, 2019, 01:41:06 AM »
While looking at the code i came up with this fix: https://github.com/SimpleMachines/SMF2.1/pull/5443
please test it.

Offline iso

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
    • station23
Re: User statistics - A non well formed numeric value encountered
« Reply #3 on: February 17, 2019, 07:20:45 AM »
Hi,
return of the query:

Code: [Select]
id_board name num_posts message_count percentage
26 Forenregeln und Nutzungsbedingungen 2 1 50.0000
9 Tutorials 122 50 40.9836
6 Mod-Ecke 555 167 30.0901
7 Ank√ľndigungen und Mitteilungen 53 15 28.3019
13 Softwareempfehlungen 122 32 26.2295
10 Admin-Ecke 9 2 22.2222
24 Informationen 6 1 16.6667
12 Mod-Archiv 1023 130 12.7077
22 Veraltete Tutorials [nur lesen] 244 29 11.8852
5 Plugins 5601 615 10.9802


fix work - thanks