This release is basically a code overhaul and does not contain any functionality changes. In short, I've updated the code to fit PSR-2 standards and re-created the models/crud via gii (to incorporate the many changes since then).
To sync your app with this version:
(Major changes)
-
Change table name
tbl_userkey
totbl_user_key
in your sql database -
If you extended the DefaultController and/or email view files, change variable names
$userkey
to$userKey
(notice the capitalization of the letter "K") -
If you extended the view files, remove
viewPath
from module configuration and usecomponents => view => theme
instead
// @app/config/web.php
'modules' => [
'user' => [
'viewPath' => '@app/views/user', // REMOVE THIS
],
],
'components' => [
'view' => [
'theme' => [
'pathMap' => [ // SET THIS INSTEAD
'@vendor/amnah/yii2-user/views' => '@app/themes/user', // example: @app/themes/user/default/profile.php
],
],
],
],
- If you overrode
DefaultController::actionReset()
,models\forms\ResetForm
, or thedefault/reset.php
view file, you will need to change the references of$model
to$user
. This is because the ResetForm model has been removed, and the reset functionality now uses the User model instead (with scenario "reset").
(Minor changes - you most likely won't need to do these)
-
If you used the guest role, re-add it back into the Role model
const ROLE_GUEST = 3
-
If you overrode
models\User::setLoginIpAndTime()
, change the name tomodels\User::updateLoginMeta()
-
If you overrode
Module::_checkEmailUsername()
, change the name toModule::checkModuleProperties()
-
If you overrode
Module::_getDefaultModelClasses()
, change the name toModule::getDefaultModelClasses()
(no underscore) -
If you overrode
DefaultController::_calcEmailOrLogin()
, change the name toDefaultController::afterRegister()
-
If you overrode
AdminController::actionIndex()
,models\search\UserSearch
, or theadmin/index.php
view file, you will need to check to see if the $profile->full_name works properly. Typically, you would need to change this in the view file:
// views/admin/index.php
// change this
[
'attribute' => 'full_name',
'label' => 'Full Name',
'value' => function($model, $index, $dataColumn) {
return $model->profile->full_name;
}
],
// to this
'profile.full_name',