-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Error Message ? #1328
Comments
i guess the problem is the model - not the session |
Hi, in controller I got this error message: ErrorException APPPATH/Controllers\Item.php at line 15 I think this error message is more meaningful rather than in the model |
By default on controllers there is no class property with the session. You must define one yourself, or get an instance of the session use the Service or the helper:
Not an error with the framework. You're just trying to use it like it's CI3... |
Bro you just saved my project, thanks bro, i have been battling with this same error thinking is from my database not knowing is session error, i got the misleading error message below while the main error is from session. thanks bro... CRITICAL - 2023-07-11 11:25:36 --> You must set the database table to be used with your query. |
I recommend all of you don't use Session in Models. |
Yea learnt that the had way already, the problem is that CI3 doesn't flag
it as CI4 does
…On Wed, Jul 12, 2023, 12:11 AM kenjis ***@***.***> wrote:
I recommend all of you don't use Session in Models.
Passing a value in the session to models is sufficient and better.
—
Reply to this email directly, view it on GitHub
<#1328 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJAU7YAWTNM4BCDV2JWJOFTXPXMQXANCNFSM4F55L5FQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I totally agree that assign a value in the session to models is sufficient and better. |
Hi, when I call the session but it not initiated, CI4 gives an error on database instead of the session itself (this might confuse developers, they might guess the error come from database connection), for example, if I call:
$this->session->get('user_id');
form Models/WelcomeModel.php
it gives an error message:
CodeIgniter\Database\Exceptions\DatabaseException #8
You must set the database table to be used with your query. search →
BASEPATH/Database\BaseConnection.php at line 933
The text was updated successfully, but these errors were encountered: