-
Notifications
You must be signed in to change notification settings - Fork 104
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
Undefined class constant 'STATUS_INACTIVE' #179
Comments
Woops I think that previous comment is wrong. What you probably need to do is update the common/models/User.php file completely. It would need to extend my User class, like so: <?php
namespace common\models;
use Yii;
use amnah\yii2\user\models\User as BaseUser;
class User extends BaseUser
{
} |
I tried several things, none of which worked:
1. I tried having the component and module config in common/config/main.php with the User class modified as you have it below. /user/admin and /user/account still give an Object not found error.
2. Then, I tried making the component and module config in the backend/config/main.php and frontend/confic/main.php and adding the modified User class to both apps. That still gave me an Object not found on any /user/… URL.
From: amnah [mailto:[email protected]]
Sent: Tuesday, December 27, 2016 5:46 AM
To: amnah/yii2-user <[email protected]>
Cc: LarryTX <[email protected]>; Author <[email protected]>
Subject: Re: [amnah/yii2-user] Undefined class constant 'STATUS_INACTIVE' (#179)
Woops I think that previous comment is wrong. What you probably need to do is update the common/models/User.php <https://github.com/yiisoft/yii2-app-advanced/blob/master/common/models/User.php> file completely.
It would need to extend my User class, like so:
<?php
namespace app\models;
use Yii;
use amnah\yii2\user\models\User as BaseUser;
class User extends BaseUser
{
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#179 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AABRB1I70qVdYm8KmWY0kgu041w_9pTeks5rMPp9gaJpZM4LWEy2> .
|
Wait, how did you log in the first time - what was the url? Did you set up pretty urls? |
Actually, I remembered that I logged in through the frontend before I installed your extension, so it was the advanced template that Yiii2 installs.
I did set up pretty URLs.
Date: Tue, 27 Dec 2016 09:01:06 -0800
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [amnah/yii2-user] Undefined class constant 'STATUS_INACTIVE' (#179)
Wait, how did you log in the first time - what was the url?
Did you set up pretty urls?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
i dont think your pretty urls is working. did you set up pretty urls properly? http://www.yiiframework.com/doc-2.0/guide-start-installation.html#recommended-apache-configuration your error is an apache error, it's not even getting into php yet so it has nothing to do with yii2 or my module |
I will research the error in the Apache logs. I'm pretty sure that I set up pretty URLs correctly. First, this is about the 500th time that I've set up a Yii2 site, and they've worked every other time. More importantly, this site currently has about 15 models with associated CRUD. Before I installed your extension, the pretty URLs were working for every single one of those. I usually don't do much in the way of security until after a site is virtually ready to go.
Date: Tue, 27 Dec 2016 11:23:28 -0800
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [amnah/yii2-user] Undefined class constant 'STATUS_INACTIVE' (#179)
i dont think your pretty urls is working. did you set up pretty urls properly?
http://www.yiiframework.com/doc-2.0/guide-start-installation.html#recommended-apache-configuration
your error is an apache error, it's not even getting into php yet so it has nothing to do with yii2 or my module
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hmmm ok that's weird then. Ok, assuming that your pretty urls are working, let's take a step back. Did you update your nav links to point to the new urls? It should look something like this $menuItems[] = ['label' => 'Signup', 'url' => ['/user/register']];
$menuItems[] = ['label' => 'Login', 'url' => ['/user/login']]; After that's done, go to your site and check the urls. What's the exact url that it generated? Copy/paste that here please. Then click the link and try to go to the page. Does the page load successfully? |
Actually, I never bother with the nav links. I type the URL directly in the address bar. When it doesn't work, I retype it several times to make sure.
Date: Tue, 27 Dec 2016 12:37:37 -0800
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [amnah/yii2-user] Undefined class constant 'STATUS_INACTIVE' (#179)
Hmmm ok that's weird then. Ok, assuming that your pretty urls are working, let's take a step back.
Did you update your nav links to point to the new urls?
It should look something like this
$menuItems[] = ['label' => 'Signup', 'url' => ['/user/register']];
$menuItems[] = ['label' => 'Login', 'url' => ['/user/login']];
After that's done, go to your site and check the urls. What's the exact url that it generated? Copy/paste that here please.
Then click the link and try to go to the page. Does the page load successfully?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Larrytx fix for the issue in yii2-advanced is in your config/main.php you need to remove "user" array item from component from backend / frontend and you shall have this workling.Thank you |
User's module may be connected on /common |
I just installed your module and attempted to log in with the neo/neo credentials. It returned a Fatal PHP error: Undefined class constant 'STATUS_INACTIVE'. See attached image of the complete error message.
I could probably figure out how to make it work, but I thought you might want to fix it so someone else doesn't run into the same error. If I've done anything wrong, please don't hesitate to let me know.
The text was updated successfully, but these errors were encountered: