CMS 1.1.3.1 release and notice problem

General project discussion. NOT for help questions.
Post Reply
Bobonov

CMS 1.1.3.1 release and notice problem

Post by Bobonov »

This post is just to reassure people about the reported notice message, no problem, no instability no errors are due to the reported problem.

Firstly I report the post in the forum with the fix:

http://forum.cmsmadesimple.org/index.ph ... 328.0.html
http://forum.cmsmadesimple.org/index.ph ... l#msg76171

The two notice problem that have been reported are related to error that do not compromise the code.
Normally in a production environment warning and notice should be disable both for "cleaning" and security reason, they are useful mostly for developer environment.
Even if a code should be notice and warning free, sometime we developer do expect and or relay on them.
For instance if I look for a value in a variable in the get array I can safely do the following test

if ($_GET['myVar']==100)

But if in the $_GET array there is no such index the execution generate a notice but still the code do exactly what is meant to do

To avoid the notice you should first check if it exist then check the value
if (isset($_GET['myVar']) AND $_GET['myVar']==100)

But this code is much slower compared to the first one because of the execution of a function. before the check

Normally when we do expect that our code generate a notice we should suppress the eventual message using @ just to be sure that in a production environment it does not show off

if (@$_GET['myVar']==100)

Even if the reported "error" are for different reasons than the example above, they do not compromise in any way the code and the execution react as expected.

As I said it is possible to disable such messages from the php.ini
Those that have access to their php.ini should know how to do but anyway search for for a line that start with

error_reporting

probably there are more than one  and you should look for the one without ; at the begin

and change it in:
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

After saving reload or restart your web server.
In this way only fatal error are generated.

Other people, that do not have access to their php.ini, can add in the cms made simple config file the following line:

error_reporting(E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR);
Post Reply

Return to “General Discussion”