XF 2.0 Xenforo 2, XAMPP and PHP Errors (I need to enable all errors display)

Scandal

Well-known member
Hello all!
Well, I have a localhost XF2 board where I'm developing my addons. It is based on XAMPP with PHP 7 (Windows 10).

The issue is that sometimes my completed addons showing some errors on other boards (servers). The most common errors are:
  • Undefined variable X
  • Undefined index X (for arrays)
... cause sometimes I forgot to initiate some variables.

But on my own localhost board I can't see them.
How could I enable them?

I have apply this on my php.ini with no results.
error_reporting= E_ALL
display_errors=On

Thanks :)
 
I'm going to try to explain this and I hope it makes sense.

When you're working on your development system you are more than likely working with a full data set for your add-on and you won't see any errors.

However, when a user installs the add-on they do not have any of the data you might expect. So, when they access a page and a value isn't set for say an array index (IE: $thread->your_data) they will receive the error.

The way around that can be accomplished in three ways.
  1. Define default values in your code
  2. Check if a value is set prior to any check of a value (IE: if (isset($thread->your_data) && $thread->your_data == 'XYZ') )
  3. Make sure you have default values set for database columns
I hope that's clearer than mud. ;)
 
Back
Top Bottom