dallen33,
Awesome! Thanks dude!
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 10, 2010 7:00pm
Subscribe [287]#1051 / Aug 29, 2011 12:17pm
dallen33,
Awesome! Thanks dude!
#1052 / Aug 29, 2011 12:24pm
@Ben Edmunds : Thank you,.... sorry to ask the same question through e mail, spark and this forum,.....
#1053 / Aug 29, 2011 2:05pm
I am trying to run
$user = $this->ci->ion_auth_model->user($id)->row();
and it throws the errors
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Admin::$_where
Filename: core/Model.php
Line Number: 50
A PHP Error was encountered
Severity: Notice
Message: Indirect modification of overloaded property Ion_auth_model::$_where has no effect
Filename: models/ion_auth_model.php
Line Number: 753
it then returns the user info for the currently logged in user.
in your user function in ion_auth_model.php
if i remove the lines:
if (isset($id))
$this->where($this->tables['users'].'.id', $id);then the error goes away, but obviously im not getting the correct user
#1054 / Aug 29, 2011 2:07pm
ripken204,
You should be calling it through the library, not the model. What happens if you do:
$user = $this->ci->ion_auth->user($id)->row();#1055 / Aug 29, 2011 2:09pm
still throws the same errors
in function users in the model
//run each where that was passed
if (isset($this->_where))
{
foreach ($this->_where as $where)
$this->db->where($where);
unset($this->_where);
}
if i comment out unset then the errors go away and i get the correct result
#1056 / Aug 29, 2011 2:11pm
maybe doing
$this->_where = array();instead of
unset($this->_where);is what you meant? you are trying to unset an array instead of reinitalizing an array.
unset is just for array keys
after that change, it’s working fine for me
#1057 / Aug 30, 2011 1:41am
maybe you can try without “ci”
$profile = $this->ion_auth->current()->user()->row_array();That’s work for me
I think we will only use $this->ci (which is usually refer to CI instance) only outside model and controller
#1058 / Aug 30, 2011 10:56am
ripken204,
Unset() works just fine on arrays for me. What PHP version are you using?
#1059 / Aug 30, 2011 10:57am
ripken204,
Looks like it’s supported in PHP4 as well… So I’m not sure what’s up with that. Are you seeing an error on unset?
#1060 / Aug 31, 2011 5:42pm
Hi Ben.
I’m getting a similar error w/ Ion Auth 2.0.4 on the login() method, but ONLY if $remember = TRUE. If $remember is FALSE, neither of the following notices are triggered.
Severity: Notice
Message: Undefined property: Signup::$_where
Filename: core/Model.php
Line Number: 50
Severity: Notice
Message: Indirect modification of overloaded property Ion_auth_model::$_where has no effect
Filename: models/ion_auth_model.php
Line Number: 743
if ($this->ion_auth->register($username, $password, $email, $additional_data)) {
if ($this->ion_auth->login($email, $password, TRUE)) {
$this->session->set_flashdata('info_msg', 'Great! Youre signed up!');
} else {
//shouldn't ever come here, but . . .
$this->session->set_flashdata('info_msg', 'Successful sign up. Youll need to log in.');
}
redirect('/', 'refresh');
}If I add a placeholder $_where variable to my signup controller, the first notice goes away, but the second remains.
public $_where = array();I took a look at the login() and remember_user() functions in the model, to see if I could understand what was happening with $_where, but nothing leaped out at me.
Using PHP Version 5.3.1 (on Windows w/ XAMPP). LMK if there’s anything more I can add to help troubleshoot. Thanks for writing Ion Auth.
Matt
#1061 / Sep 01, 2011 3:26pm
me too having same problem.
A PHP Error was encountered
Severity: Notice
Message: Indirect modification of overloaded property Ion_auth_model::$_where has no effect
Filename: models/ion_auth_model.php
Line Number: 744I have googled it and i can see this error on this page as well.
#1062 / Sep 01, 2011 7:03pm
ripken204,
Looks like it’s supported in PHP4 as well… So I’m not sure what’s up with that. Are you seeing an error on unset?
im using 5.3.6
what i did fixed the issue (for me)
i am not seeing any side effects so i am happy.
i dont have much time to look into the details of it right now though, trying to get this site done as soon as possible.
also, this is a PHP notice. do you have notices enabled?
and based on some quick google searches, it may be only in 5.2.x and above
#1063 / Sep 03, 2011 11:42pm
I just want to let everyone know that with 2.0.5 the where issues have been fixed along with a few other things.
Also NOTE, I removed META completely so you’ll have to modify your DB accordingly. All user data is now stored in the users table. I never really liked the idea of a separate meta table but kept it for backwards compatibility. Now that we’re breaking compatibility we might as well go all out.
Removing the meta table will increase performance since we are only querying the users table, also now you can just add a field to the users table and it’s there, no need to worry about the config settings.
#1064 / Sep 03, 2011 11:47pm
Ben, was the where issue due to the newer PHP versions?
I’m going “upgrade” to 2.0.5 right now, might as well give it a try since im still in dev on a site. hopefully all goes smooth
#1065 / Sep 03, 2011 11:48pm
No, the where issue was because I was unsetting where but then PHP assumes it was overloaded since it didn’t exist. I just had to change to code to set $_where = NULL instead of unsetting it.