Advertisement:

Author Topic: Warning: A non numeric value encountered in...  (Read 5736 times)

Faïti

  • Newbie
  • *
  • Posts: 14
Warning: A non numeric value encountered in...
« on: February 24, 2017, 12:25:56 am »
This is the message I get on my website: Warning: A non-numeric value encountered in xxxxx/xx/xxxx/public_html/oc-includes/osclass/model/Search.php on line 511.
Same message for line 512.
So I went in my host file manager in public_html/oc-includes/osclass/model/Search.php but I cannot count the line 511 and 512 and I dont know what to change anyway.
Can someone help please?  :)

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #1 on: February 24, 2017, 05:33:00 am »
its just a warning, that your script trys to autofill a non-numeric value into an number input field...

you can ignore it or search for an
Code: [Select]
<input type="number" ... />
and try to fix the "mistake"

Faïti

  • Newbie
  • *
  • Posts: 14
Re: Warning: A non numeric value encountered in...
« Reply #2 on: February 27, 2017, 10:34:38 pm »
Thank you. I cannot ignore it since it appears on my web page. I looked into the script and cannot find <input type="number" ... />
Also My website is boatlab.org when I click on "sale" it redirect me to boatlab.000webhost.com (my host)

« Last Edit: February 27, 2017, 11:26:54 pm by Faïti »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #3 on: February 27, 2017, 10:51:43 pm »
go to your config.php in your osclass main-directory and

change
Code: [Select]
define('OSC_DEBUG', true);
to
Code: [Select]
define('OSC_DEBUG', false);
then... what did you entered here?
Code: [Select]
define('REL_WEB_URL', '???');
define('WEB_PATH', '???');


Faïti

  • Newbie
  • *
  • Posts: 14
Re: Warning: A non numeric value encountered in...
« Reply #4 on: February 27, 2017, 11:25:24 pm »
Ok Thanks for your answer.
I changed: define('WEB_PATH', 'https://boatlab.000webhost.com'); by define('WEB_PATH', 'https://boatlab.org');  now the domain seems to work.
I haven't changed anything at:  define('REL_WEB_URL', '???'); Please see photo. What should I change?
I cannot find: define('OSC_DEBUG', true);

We're getting there!
« Last Edit: February 27, 2017, 11:30:09 pm by Faïti »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #5 on: February 27, 2017, 11:32:02 pm »
only if your installation is located in a subdir, you have to change REL_WEB_URL

so now should all be fine


if you find some
Code: [Select]
ini_set('display_errors', 1);

change it to, to disable error reporting
Code: [Select]
ini_set('display_errors', 0);
« Last Edit: February 27, 2017, 11:37:07 pm by Liath »

Faïti

  • Newbie
  • *
  • Posts: 14
Re: Warning: A non numeric value encountered in...
« Reply #6 on: February 27, 2017, 11:47:53 pm »
I cannot find ini_set('display_errors', 1);  in config.php

« Last Edit: February 27, 2017, 11:56:12 pm by Faïti »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #7 on: February 27, 2017, 11:50:28 pm »
maybe in other files


try to add this line in config.php at first line after the opening php tag


Code: [Select]
ini_set('display_errors', 0);

Faïti

  • Newbie
  • *
  • Posts: 14
Re: Warning: A non numeric value encountered in...
« Reply #8 on: February 27, 2017, 11:55:55 pm »
Yes That works!!!
You're the man!!! I was so down with all this! I m so glad I have a bit of patience...and a good Osclass forum with great people :)
I include a screenshot to help others.

Thank you sooo much :)
« Last Edit: February 27, 2017, 11:57:37 pm by Faïti »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #9 on: February 27, 2017, 11:56:26 pm »
you're welcome :)

Aficionado

  • Guest
Re: Warning: A non numeric value encountered in...
« Reply #10 on: March 04, 2017, 01:28:44 am »
maybe in other files


try to add this line in config.php at first line after the opening php tag


Code: [Select]
ini_set('display_errors', 0);

Liath don't you think this is irregular and not needed in a proper server and hosting plan ?

You both are going to the wrong direction.


dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Warning: A non numeric value encountered in...
« Reply #11 on: March 04, 2017, 02:29:26 am »
@Faïti

This should not happen, if someone enters non-numeric value into the price field (my best guess what caused this from your error), and under normal circumstances it should not generate any warning. Mind you, a php "warning" is much serious event than a "notice", and should be taken care of [!]. However, I cannot trigger it on my end, core files takes care of this event properly. So, what could be wrong on your side - it's a puzzle, and without some details from your server logs, and setup, hard to reproduce and locate.

The answer itself might be in your free/bad host - 000webhost.

Turning off php reports from public on production site is, of course, a good [security] idea, but it does not help you in any way if you hide them entirely or ignore from your internal logs.

Regards

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Warning: A non numeric value encountered in...
« Reply #12 on: March 05, 2017, 11:04:04 pm »
Liath don't you think this is irregular and not needed in a proper server and hosting plan ?

You both are going to the wrong direction.


maybe its not the bes/right way, it should only disable the error reporting

Faïti

  • Newbie
  • *
  • Posts: 14
Re: Warning: A non numeric value encountered in...
« Reply #13 on: March 22, 2017, 12:19:27 am »
I had a look in my debug.log and found a insane amount of bug reports.
From what I understand from you guys is that all the bugs come from 000webhost? Will they disappear if I change my hosting service?

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Warning: A non numeric value encountered in...
« Reply #14 on: March 22, 2017, 12:22:44 am »
Not necessarily. Log will tell you in general where the "bug" is, and it may be due to the hosting, particular environment, php config or version, or something else (core, theme, plugin).

It is impossible to say exactly what is the cause of it upfront. But, it is a good idea to have something to compare with, for start.

For start, we don't know anything about your server, which version of PHP you run, MySQL (or other), what is your php.ini config etc.