dgrigg / craft-migration-assistant

Migration Manager for Craft CMS
Other
27 stars 10 forks source link

Undefined array key "permissions" error after upgrade to Craft4 #51

Closed xinningsu closed 1 year ago

xinningsu commented 1 year ago

Hi, need some help here. I recently I tried to upgrade Craftcms from Craft Pro 3.7.55.2 to Craft Pro 4.3.6.1, migration-assistant from 3.2.7 to 4.0.0-beta.1 there is no error in migration, but when I try to edit a user group, I got this error:

[web.ERROR] [yii\base\ErrorException:2] Undefined array key "permissions" {"trace":["#0 /app/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\\base\\ErrorHandler->handleError()","#1 /app/vendor/craftcms/cms/src/services/UserPermissions.php(759): craft\\web\\ErrorHandler->handleError()","#2 /app/vendor/craftcms/cms/src/services/UserPermissions.php(210): craft\\services\\UserPermissions->_filterOrphanedPermissions()","#3 /app/vendor/craftcms/cms/src/controllers/UserSettingsController.php(100): craft\\services\\UserPermissions->saveGroupPermissions()","#4 [internal function]: craft\\controllers\\UserSettingsController->actionSaveGroup()","#5 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#6 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#7 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#8 /app/vendor/craftcms/cms/src/web/Application.php(301): yii\\base\\Module->runAction()","#9 /app/vendor/craftcms/cms/src/web/Application.php(625): craft\\web\\Application->runAction()","#10 /app/vendor/craftcms/cms/src/web/Application.php(280): craft\\web\\Application->_processActionRequest()","#11 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#12 /app/web/index.php(84): yii\\base\\Application->run()","#13 {main}"],"memory":18537592,"exception":"[object] (yii\\base\\ErrorException(code: 2): Undefined array key \"permissions\" at /app/vendor/craftcms/cms/src/services/UserPermissions.php:759)"} 

I output all the groups here https://github.com/craftcms/cms/blob/develop/src/services/UserPermissions.php#L759, looks it's related to Migration Assistant, no 'permissions' there

    'Migration Assistant' => [
        'createContentMigrations' => [
            'label' => 'Create content migrations'
        ]
    ]
    18 => [
        'heading' => 'Navigation'
        'permissions' => [

Any idea why?

dgrigg commented 1 year ago

@xinningsu unfortunately the Migration Assistant doesn't support Craft 4 https://github.com/dgrigg/craft-migration-assistant/issues/50