News:

Wondering if this will always be free?  See why free is better.

Main Menu

Type error in Subs.php

Started by borish, October 03, 2014, 04:17:21 PM

Previous topic - Next topic

borish

I keep getting the following error:

2: number_format() expects parameter 1 to be double, string given
File: /mnt/webb/e3/15/53865815/htdocs/WordPress_02/forum/Sources/Subs.php
Line: 742


Each time I post something, I get this entry in the error log. I use SMF 2.0.8, SimplePortal 2.3.5, Good Post/Bad Post Mod 2.0.4, Additional Polls 1.2.2, Registration Password 1.1 (modified by me). The host uses php 5.3.

kat

Might be good to attach that file to your next post, so that we can take a look at it. :)

borish

The offending line is

// Format the string with our friend, number_format.
return number_format($number, is_float($number) ? ($override_decimal_count === false ? $decimal_count : $override_decimal_count) : 0, $decimal_separator, $thousands_separator);
}

kat

Nothing wrong, there, that I can see. But, it'd be better to attach the whole file, coz errors often get reported wrongly, with regard to the lines and things.

If there's an error in a previous line, it might not cause the actual error, until further on (If that makes sense).

borish

Well, I did attach the whole file. Obviously, $number has the wrong type when the error occurs.

kat


kat

Odd... Further down, on line 891, there appears to be something missing, at the end. On line 915, there's a weird difference and there are a few others, too, which sure don't seem to have been caused by any mod installs.

I'd suggest trying a virgin copy of the file. But, as the mods you have probably edit Subs.php, that'd be bound to screw something.

When you say "Registration Password 1.1 (modified by me)", I have to wonder if you did something to that file...

borish

I didn't modify anything in Subs.php. That file was modified today when I upgraded to 2.0.8 to fix a serious problem with posting in 2.0.6. There's no patch for 2.0.9 yet in the package manager.

Since 2.0.6 however, there have been problems with the forum statistics however. The numbers for the maximum number of members online have always been wrong.

Ninja ZX-10RR

This is what happens when you don't try to fix the problems as soon as they come out... I'd uninstall all those mods (luckily they are really few), upload a virgin subs.php and then install your mods back paying more attention to eventual problems.
P.s. I hope that when you said that you upgraded from 2.0.6 you went there via upgrading to 2.0.7 first...
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Hj Ahmad Rasyid Hj Ismail

Minimal number of mods. If I were you, I "will" use full upgrade version to fix this. Please do full backup though, as always.

Ninja ZX-10RR

A full upgrade wouldn't fix the broken subs.php though. He would have to upgrade a virgin copy of it anyway first...
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Hj Ahmad Rasyid Hj Ismail

??? Full upgrade package replaces everything and that includes Subs.php.

Ninja ZX-10RR

My bad I was thinking about large upgrade and consistently writing "full" XD ignore the above :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Hj Ahmad Rasyid Hj Ismail

No problem. But if anybody is against this idea, I will say yes too because a simple uploading the clean original Subs.php will also do the trick. Then uninstall the mods and reinstall them back. I will take the full upgrade way since I have high speed internet, if yours is otherwise, replacing the with the clean original Subs.php is better and faster.

borish

Quote from: ♦ Ninja ZX-10RR ♦ on October 04, 2014, 01:59:38 AM
This is what happens when you don't try to fix the problems as soon as they come out... I'd uninstall all those mods (luckily they are really few), upload a virgin subs.php and then install your mods back paying more attention to eventual problems.
I did try to fix the problem with the forum statistics in this thread http://www.simplemachines.org/community/index.php?topic=517155.msg3658097#msg3658097, but no solution was found.

QuoteP.s. I hope that when you said that you upgraded from 2.0.6 you went there via upgrading to 2.0.7 first...
Yes.

What is a "full upgrade"? The manual mentions fresh install, large upgrade and patching. According to http://download.simplemachines.org/, the large upgrade will upgrade/reset your forum to a clean install of the latest version and will remove all modifications. Which procedure should I use, what happens to the data base connection and to the forum content that relies on the mods?

Hj Ahmad Rasyid Hj Ismail

It is as simple as putting your forum into maintenance mode and uploading the full upgrade package overwriting your current SMF forum. Then you go to yourforumdomain.tld/upgrade.php which will run the full upgrade. If there is no problem and that finished well, you will have a fresh upgraded forum without any mods (except mods that are using hook). Reinstall your mod(s) and when you finished, put your forum back to active mode.

But do make a full backup of both files and database. You can read and follow the following wiki advices:
Upgrading SMF
Forum Maintenance
How do I backup my SMF forum?
How do I backup my database?

Ask further, if you are not sure how to perform any of the above.

Illori

actually i would recommend http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files instead.

if the op is on 2.0 or later release they dont need to run upgrade.php as there are no database changes.

borish

All right, I'll try the latter. After upgrading, can I put my forum back to active mode and install the mods afterwards one by one? If so, I may check if a mod causes any problems. Most of my mods aren't for 2.0.9, so I must use version emulation. As a side note, are the 2.0.x releases bug fix releases only that don't change the API?

kat

Some fixes are security-related, rather than bug-fixes.

I know it's tedious... But, you can backup, install a mod, check it, if it's OK backup, again, install another mod, check it, if it works, backup, &c. &c.

If that's WAAAY to tedious, you could pray and rely on this:

http://www.simplemachines.org/community/index.php?topic=479640.0

Kindred

However, 2.0.7 and 2.0.8 changed some internal stuff (thus affecting 2.0.9 and all future versions) which may have effects on the API, since there were some changes to preg_replace... And I am not sure exactly, if the API uses that...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: