Welcome Guest, Not a member yet? Register   Sign In
[URGENT] Call to a member function load() in Form Validation
#1

[eluser]Mareshal[/eluser]
How to fix this error?

Fatal error: Call to a member function load() on a non-object in /home/admin/domains/1ms.in/public_html/*****/core/libraries/Form_validation.php on line 316

Form validation is autoloaded
#2

[eluser]Mareshal[/eluser]
I can't even do this:
$this->output->enable_profiler(TRUE);

I get same error in Loader.php

What the hell is wrong?
#3

[eluser]codeshadow[/eluser]
Hi,

It looks that you are trying to call the function on an invalid object name. Did you modify the form validation library? This usually happens when you try to call methods in libraries, models, controllers, views, and so on if you try to access those with an invalid instance or probably give incorrect parameters within...

Can you post the entire error message? As in the box above your current error that denotes the severity of the error. You will find information on the invalid object in that box.

Also, what does line 316 of your form validation library contain? If I'm not wrong it is the part that loads the language ....??

:roll:
#4

[eluser]Mareshal[/eluser]
$CI =& get_instance();

this is at line 316. Anyway, I've fixed that by downloading latest ci from svn. I don't know what was the mistake. Usually when that kind of error comes form my script I can solve it, but that was annoying. I spent 5 hours debugging and nothing...
#5

[eluser]codeshadow[/eluser]
OK,

I think it should have been:

$this->CI =& get_instance();

I am not really sure about it though...But anyways, you have got your code working...

enjoy!
#6

[eluser]Mareshal[/eluser]
I had 1.7.2 in that error. But the other thing that was annoying me is that my own site is built on ci 1.7.2 without issues
#7

[eluser]codeshadow[/eluser]
I get your point buddy! Well but as you know, CI errors are very informative...so I am yet pretty sure that it would have been about some instantiation problem...

Did you try adding $this-> to your code while debugging? Or probably, if you still have a backup somewhere...just try...
#8

[eluser]codeshadow[/eluser]
Alternatively, it would be worth checking it in the fresh copy...
#9

[eluser]Mareshal[/eluser]
[quote author="Mareshal" date="1265068663"]$CI =& get_instance();[/quote]

My bad,

line 316 is this:

Code:
$this->CI->lang->load('form_validation');

and for no reason today when I checked again I get same error :|
#10

[eluser]Mareshal[/eluser]
OK, I am coming with the solution.

I was using $lang as $this->lang which is a conflict with line 316. whatever, $lang is not a reserved word, can't find it here: http://ellislab.com/codeigniter/user-gui...names.html




Theme © iAndrew 2016 - Forum software by © MyBB