-
Notifications
You must be signed in to change notification settings - Fork 12
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
Initial install of Yii Advanced - Username doesn't exist #35
Comments
Pluto install:
A few preliminaries... Make sure
is installed under common/config/main.php Make sure
is included in the .htaccess file in the web folder under frontend ie. frontend/web. Double Check... Moved the files m130524_201442_init.php and, into a temp folder under The answer otherwise is relatively simple. Personal choice. Sjaakp User model/table uses the field 'name' for the user. If you look in the migration file which is in
whereas in the advanced template User
Have you removed:
from your
Note the Ensure you have:
in your Replace the ONLY TWO occurrences (frontend/views/layouts/main.php AND backend/views/layouts/main.php) of: with The
The bootstrap public function in
You will see the merge command here. As noted in vendor\yiisoft\yii2\helpers\BaseArrayHelper here:
So the sjaakp user settings model will overwrite the advanced template even though it "merges" them because they have the same user setting. So there is no need for the components user settings in the frontend and backend ..../config/main.php. A longwinded explanation but good for posterity I hope.
|
Thanks @rossaddison, I'll run though it on my end as well. Will probably be a week before I have time, but I'll document if I have an issues. |
After initial install of the Yii Advanced template (what I'm currently testing)
Your user table replaces the default Yii table.
In this process it renames
username
toname
this will throw errors in frontend and backend when logging in.
as username is called
ex: backend/views/main.php - line 67
Yii::$app->user->identity->username
and activeRecord - in /common/models/User.php
$this->_user = User::findByUsername($this->username);
These can all be replaced, but not sure why we need to rename
username
toname
I can update the references by pointing them to name instead of username, but seems like extra work
FYI - I get that it is by design that you are trying to override the Identity class.
However it doesn't seem to happen completely
In my fresh install
sjaakp\pluto\models\User
did not replace the Identity class.The text was updated successfully, but these errors were encountered: