TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,947
  • Latest: sgm09
Stats
  • Total Posts: 195,740
  • Total Topics: 21,279
  • Online today: 300
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Numeric Error Bugs - PHP 7.1

Started by tino, June 20, 2018, 07:16:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tino

These seem to have been missed at some point  :-[

Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 87.185.75.27   
    Reverse chronological order of list Today at 04:44:53 PM
Apply Filter: Only show the error messages of this session ec893a61bd4b2972f2b654b62c5e20ca
Apply Filter: Only show the errors of this type Type of error: General
Apply Filter: Only show the error messages of this URLhttps://www.fedupwithliberals.com/index.php?&action=profile;area=tparticles;u=1Apply Filter: Only show the errors with the same message2: A non-numeric value encounteredApply Filter: Only show the errors from this file File: /home/delta5/public_html/Sources/TPmodules.php
Line: 1231


1212:            art.author_id as authorID, art.category, art.locked   
1213:         FROM {db_prefix}tp_articles AS art
1214:         WHERE art.author_id = {int:auth}
1215:         ORDER BY art.{raw:sort} DESC LIMIT {int:start}, 10',
1216:         array('auth' => $memID, 'sort' => $sorting, 'start' => $start)
1217:      );
1218:     
1219:      if($smcFunc['db_num_rows']($request) > 0){
1220:         while($row = $smcFunc['db_fetch_assoc']($request))
1221:         {
1222:            $rat = array();
1223:            $rating_votes = 0;
1224:            $rat = explode(',', $row['rating']);
1225:            $rating_votes = count($rat);
1226:            if($row['rating'] == '')
1227:               $rating_votes = 0;
1228:   
1229:            $total = 0;
1230:            foreach($rat as $mm => $mval)
==>1231:               $total = $total + $mval;
1232:   
1233:            if($rating_votes > 0 && $total > 0)
1234:               $rating_average = floor($total / $rating_votes);
1235:            else
1236:               $rating_average = 0;
1237:           
1238:

lurkalot

Yes I saw that reported over at the other place.  Is this a php 7.1 /7.2 thing, just I thought Pete = Arantor caught most of those errors a while back.  Obviously not this one. 

tino

Quote from: lurkalot on June 20, 2018, 07:38:19 PM
Yes I saw that reported over at the other place.  Is this a php 7.1 /7.2 thing, just I thought Pete = Arantor caught most of those errors a while back.  Obviously not this one.

Yeh it's a PHP7.1/2 thing, I checked and it was fixed in a load of places. Just missed here and somewhere else. I don't think I undid it when merging the responsive code but I might off. Either way it will be fixed in TP 1.5.1

I don't think TP should support 7.2 yet mainly as SMF has a fit when I try it on that version.

lurkalot

Quote from: tino on June 20, 2018, 07:40:59 PM
Quote from: lurkalot on June 20, 2018, 07:38:19 PM
Yes I saw that reported over at the other place.  Is this a php 7.1 /7.2 thing, just I thought Pete = Arantor caught most of those errors a while back.  Obviously not this one.

Yeh it's a PHP7.1/2 thing, I checked and it was fixed in a load of places. Just missed here and somewhere else. I don't think I undid it when merging the responsive code but I might off. Either way it will be fixed in TP 1.5.1

I don't think TP should support 7.2 yet mainly as SMF has a fit when I try it on that version.

I agree tino, no point supporting a php version which SMF doesn't..  Thanks for adding fix to next version.  Pete kindly stepped in and kindly offered those fixes, he could well have missed it. https://www.tinyportal.net/index.php?topic=35895.0

lurkalot


tino

Quote from: lurkalot on June 20, 2018, 08:02:07 PM
I'm assuming it's also the same issue that was discussed here, https://www.tinyportal.net/index.php?topic=35959.msg290969#msg290969

Yup, there is loads of copy and paste code, so loads of places to change it seems. Should rationalise the code really.

This website is proudly hosted on Crocweb Cloud Website Hosting.