CodeIgniter Forums
Bug in Form_validation.php? _error_messages is being reset - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Bug in Form_validation.php? _error_messages is being reset (/thread-33889.html)



Bug in Form_validation.php? _error_messages is being reset - El Forum - 09-11-2010

[eluser]seonghuhn[/eluser]
In a previous post I noted that my form validation was not working in production while it is working on my local.

Upon further investigation I found that I am properly adding my error message in the set_message function of Form_validation.php. I outputted the _error_messages array and saw that my error message was added.

However later when validation fails and Form_validation.php checks to see if the error message has the rule that failed, the _error_messages array is empty. Looking through the code though I can't see how this could be possible. I only see Form_validation initialized once so I don't think it's an issue w/ a different thread handling the validation later.

Since this is only happening in my hosted environment and not in my local I wonder if this is a PHP bug.

I am running CodeIgniter 1.7.2.

My hosted environment is PHP 4.4.9 on Apache 2.2.16 on Linux.

Locally I am running PHP 5.3.0 on Apache 2.2.14 on Windows.

Any help would be most appreciated! Should I report this bug?


Bug in Form_validation.php? _error_messages is being reset - El Forum - 09-11-2010

[eluser]InsiteFX[/eluser]
I do not think this is a bug but the version of PHP.

I would get hold of your hosting company and ask them
to upgrade the PHP version to 5.

Most hosting companies are running PHP 5.

InsiteFX


Bug in Form_validation.php? _error_messages is being reset - El Forum - 09-12-2010

[eluser]seonghuhn[/eluser]
I updated my server to use PHP 5.2.14 and it is now working. Thanks for the suggestion!