Open nandinibhaduri opened 1 year ago
How is Ion Auth loaded in your Base_Controller during testing? What if so load ion auth in the stream class?
The ion_auth is loaded from autoload.php
/*
| -------------------------------------------------------------------
| Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array(APPPATH. 'third_party/ion_auth');
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
$autoload['libraries'] = array('database', 'session', 'form_validation', 'ion_auth');
What else have you tried to troubleshoot this? What if you manually load the package in this controller?
Yes, I tried to manually load the library in the Stream class constructor...
log_message('error','Before Loading ion_auth');
$this->load->library('ion_auth');
log_message('error','After Loading ion_auth');
log_message('error',isset($this->ion_auth) ? "Ion Auth Set":"Ion Auth not Set");
log_message('error',isset($this->ion_auth_model) ? "Ion Auth Model Set":"Ion Auth Model not Set");
In the log file I see -
ERROR - 2022-08-05 04:53:59 --> Before Loading ion_auth
ERROR - 2022-08-05 04:53:59 --> After Loading ion_auth
ERROR - 2022-08-05 04:53:59 --> Ion Auth Set
ERROR - 2022-08-05 04:53:59 --> Ion Auth Model not Set
But when I am trying the delete from the UI I get:
ERROR - 2022-08-05 04:56:39 --> Before Loading ion_auth
ERROR - 2022-08-05 04:56:39 --> After Loading ion_auth
ERROR - 2022-08-05 04:56:39 --> Ion Auth Set
ERROR - 2022-08-05 04:56:39 --> Ion Auth Model Set
Hmm maybe try loading the model directly in the controller?
Tried that too. The error goes away but the groups didn't get deleted in the following code -
$this->ion_auth->delete_group($groupid);
Try adding some logging at each step there that way. Eg, does the model actually get called even if there's no error, does the DB query run, etc
@benedmunds I notice the last commit on the library around 6 or 7 months ago we are using it regularly I am worried are you people maintaining it in the future.
Hey @akashposin , I’m still actively maintaining this but it’s fairly stable after all of these years and I don’t have any new features planned.
Which branch are you using? 3
What commit hash are you on? I am not sure
What CodeIgniter version are you using? 3.1.9
What PHP version are you using? PHP 7.2.33
Post your Ion Auth config below
Describe the bug
This works from the UI but throws the following error when called from phpunit test.
Message: Undefined property: Stream::$ion_auth_model on line 129 in file C:\......\application\third_party\ion_auth\libraries\Ion_auth.php