Part of the EllisLab Network
   
 
Validation Error on 1.* versions with PHP 4
Posted: 08 November 2006 01:31 AM   [ Ignore ]  
Summer Student
Total Posts:  11
Joined  08-20-2006

I’ve noticed a bug that occurs with the validation class in a PHP 4 environment.

If $this->load->library(validation) is placed in the controller’s constructor (which is where I like to place it so that views don’t throw an undefined notice when loaded for the first time), then the validation->error_string is empty in the view on validation failure.  In the controller, the error_string is correctly initialized, but it loses itself when the the view is reloaded.

Switching to PHP 5 solves the problem.  It probably has something to do with the piss-poor object referencing of PHP 4, but I haven’t confirmed for sure.

If you must use PHP 4, simply putting $this->load->library(validation) into every controller method that uses the view will solve the problem…except for the duplicate code.

 Signature 

Scott Klarenbach
Vancouver Custom Software and Programming - PointyHat Software

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64459 Total Logged-in Users: 20
Total Topics: 80973 Total Anonymous Users: 1
Total Replies: 435720 Total Guests: 213
Total Posts: 516693    
Members ( View Memberlist )