Skip to content
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

Project Config bug when removing user role #6011

Closed
wbrowar opened this issue May 1, 2020 · 5 comments
Closed

Project Config bug when removing user role #6011

wbrowar opened this issue May 1, 2020 · 5 comments
Assignees

Comments

@wbrowar
Copy link

wbrowar commented May 1, 2020

Description

Removing a user role on a site that uses Project Config throws this error when running project-config/sync. I've checked and the UID for the user role isn't found anywhere else in the project config file.

Here's the full stack trace for the error:

2020-05-01 10:12:21 [-][-][-][error][yii\base\ErrorException:8] yii\base\ErrorException: Trying to get property 'id' of non-object in /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/UserPermissions.php:423
Stack trace:
#0 /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/UserPermissions.php(423): yii\base\ErrorHandler->handleError(8, 'Trying to get p...', '/PATH_TO_PROJECT...', 423, Array)
#1 /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/ProjectConfig.php(1102): craft\services\UserPermissions->handleChangedGroupPermissions(Object(craft\events\ConfigEvent))
#2 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#3 /PATH_TO_PROJECT/vendor/yiisoft/yii2/base/Component.php(627): call_user_func(Array, Object(craft\events\ConfigEvent))
#4 /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/ProjectConfig.php(672): yii\base\Component->trigger('removeItem', Object(craft\events\ConfigEvent))
#5 /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/ProjectConfig.php(1190): craft\services\ProjectConfig->processConfigChanges('users.groups.d8...', false, NULL, true)
#6 /PATH_TO_PROJECT/vendor/craftcms/cms/src/services/ProjectConfig.php(539): craft\services\ProjectConfig->_applyChanges(Array)
#7 /PATH_TO_PROJECT/vendor/craftcms/cms/src/console/controllers/ProjectConfigController.php(87): craft\services\ProjectConfig->applyYamlChanges()
#8 [internal function]: craft\console\controllers\ProjectConfigController->actionSync()
#9 /PATH_TO_PROJECT/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /PATH_TO_PROJECT/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /PATH_TO_PROJECT/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('sync', Array)
#12 /PATH_TO_PROJECT/vendor/craftcms/cms/src/console/Controller.php(187): yii\console\Controller->runAction('sync', Array)
#13 /PATH_TO_PROJECT/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('sync', Array)
#14 /PATH_TO_PROJECT/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('project-config/...', Array)
#15 /PATH_TO_PROJECT/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('project-config/...', Array)
#16 /PATH_TO_PROJECT/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('project-config/...', Array)
#17 /PATH_TO_PROJECT/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#18 /PATH_TO_PROJECT/craft(22): yii\base\Application->run()
#19 {main}

Steps to reproduce

Additional info

  • Craft version: Craft Pro 3.4.17.1
  • PHP version: 7.2.24
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions:

Analytics 4.0.10
Azure Blob Remote Volume 1.0.2
CP Field Inspect 1.1.3
Feed Me 4.2.2
Gold SiteCopy 0.5.2
Guide 2.1.4
ImageOptimize 1.6.13
Image Resizer 2.0.8
Inventory 2.1.0
Preparse Field v1.1.0
Redactor 2.6.1
Relabel 1.3.5
SEO 3.3.1
Super Table 2.4.9
Typed link field 1.0.21

@brandonkelly
Copy link
Member

Can you send your composer.json and composer.lock files, as well as the incoming project.yaml file, and a database backup, over to [email protected] ?

@wbrowar
Copy link
Author

wbrowar commented May 6, 2020

Sure thing! Sending it now.

@andris-sevcenko
Copy link
Contributor

Thanks for reporting that! This issue has been fixed for the next release.
To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#858afd5dad0b12eee766e1281e52b58d7d68106c",
  "...": "..."
}

Then run composer update.

@wbrowar
Copy link
Author

wbrowar commented May 11, 2020

Thanks, @andris-sevcenko and @olivierbon!

@brandonkelly
Copy link
Member

Craft 3.4.19 is out now with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants