Welcome Guest, Not a member yet? Register   Sign In
validation_errors() not printing
#1

[eluser]stef25[/eluser]
When I submit a form that runs through the following code, I just see "here" printed out. So, the rules are being processed ok since we end up in the FALSE part of the validation. The form validation library is being autoloaded.

Code:
function news()
    {
        $this->load->helper("form");
        
        if( $_POST )
        {    
            $this->form_validation->set_rules('title', 'Title', 'trim|required');
            $this->form_validation->set_rules('text', 'Text', 'trim|required');            
            
            if( $this->form_validation->run() == FALSE )
            {
                print "here:";
                print validation_errors(); die;
                $this->load->view('admin/news', $data);
            }
            
            else
            {                
                //updating news
                $this->m_admin->insert_news($image_path);
    
                redirect( $_SERVER['HTTP_REFERER'] );
            }            
        }
        
        else $this->load->view('admin/news', $data);        
    }

The last "entry" in the logs is below. I'm not sure if something's going wrong after the language file is loaded (there are no syntax errors in this file), or ... ?

The chmod Warning appears after every DEBUG line but I don't think it's relevant.

I've completed dozens of CI projects and never had this issue, the only difference being a new server and CI2.

Code:
DEBUG - 2011-02-22 15:58:00 --> Language file loaded: language/english/form_validation_lang.php
ERROR - 2011-02-22 15:58:00 --&gt; Severity: Warning  --&gt; chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted /var/www/vhosts/site/staging/system/libraries/Log.php 106

An additional issue is that if I don't autoload the form validation library and instead load it in the controller, I get an additional error:

Code:
ERROR - 2011-02-22 16:00:40 --&gt; Severity: Notice  --&gt; Undefined property: Admin::$form_validation /var/www/vhosts/site/staging/application/controllers/admin.php 76

Autoloading is ok, but not ideal.

What could cause these errors?
#2

[eluser]petroz[/eluser]
Why do you have die after printing validation_errors()?
#3

[eluser]Mike DeFelice[/eluser]
Sorry disregard, I should have read more Tongue

Just found this thread on the chmod part

http://ellislab.com/forums/viewthread/74152/




Theme © iAndrew 2016 - Forum software by © MyBB