spicywebau / craft-fieldlabels

Override Craft CMS field labels and instructions in the field layout designer
MIT License
123 stars 9 forks source link

Deleting a relabeled field does not remove reference in project.yaml, making it crash on craft setup. #45

Closed jlcharette closed 4 years ago

jlcharette commented 4 years ago

Description

If you delete a field that has been relabeled before "reverting" back to the original label, it makes the project.yaml crash on Craft setup.

Steps to reproduce

  1. Relabel a field
  2. Delete the field
  3. Relabel references are not removed from project.yaml so it crash when you try to install the project.
fieldlabels.b3f5addb-352a-441d-8937-6d3e2fb37860
fieldlabels.a2b4777f-3cc0-4d14-8fe8-cd0bdf1d6416
fieldlabels.2dd65639-6087-445c-969a-3271e0d6eb04
fieldlabels.e559ceac-9995-4528-a710-91730eb2e875
fieldlabels.f87017fb-c3da-4e7e-a0e9-41a57239432c
fieldlabels.fc3a316d-cd4c-4f4b-ab12-102b63e9e38d
fieldlabels.d9768070-694f-41e6-878c-759317d63998
fieldlabels.435da481-2d29-4e40-8754-709131aa7e04
fieldlabels.8b06c658-dfdb-4b1e-a091-a90e9451ed10
fieldlabels.8a8de623-a854-476b-b9a8-8686b07d0b85
fieldlabels.642a0272-168f-4dd3-abb9-3780e6fdd804 (/home/username/Projects/craft-wet/vendor/craftcms/cms/src/services/ProjectConfig.php:970)
#0 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/services/ProjectConfig.php(441): craft\services\ProjectConfig->_applyChanges(Array)
#1 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/migrations/Install.php(1036): craft\services\ProjectConfig->applyYamlChanges()
#2 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/migrations/Install.php(73): craft\migrations\Install->insertDefaultData()
#3 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/Migration.php(58): craft\migrations\Install->safeUp()
#4 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/MigrationManager.php(239): craft\db\Migration->up(true)
#5 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/InstallController.php(161): craft\db\MigrationManager->migrateUp(Object(craft\migrations\Install))
#6 [internal function]: craft\console\controllers\InstallController->actionCraft()
#7 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#10 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#11 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#12 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
#13 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('install', Array)
#14 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/SetupController.php(124): craft\console\Application->runAction('install')
#15 [internal function]: craft\console\controllers\SetupController->actionIndex()
#16 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#17 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#18 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#19 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#20 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#21 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('setup', Array)
#22 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('setup', Array)
#23 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('setup', Array)
#24 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#25 /home/username/Projects/craft-wet/craft(22): yii\base\Application->run()
#26 {main}
Exception 'craft\errors\MigrationException' with message 'An error occurred while executing the "craft\migrations\Install migration: The following config paths could not be processed successfully:
fieldlabels.b3f5addb-352a-441d-8937-6d3e2fb37860
fieldlabels.a2b4777f-3cc0-4d14-8fe8-cd0bdf1d6416
fieldlabels.2dd65639-6087-445c-969a-3271e0d6eb04
fieldlabels.e559ceac-9995-4528-a710-91730eb2e875
fieldlabels.f87017fb-c3da-4e7e-a0e9-41a57239432c
fieldlabels.fc3a316d-cd4c-4f4b-ab12-102b63e9e38d
fieldlabels.d9768070-694f-41e6-878c-759317d63998
fieldlabels.435da481-2d29-4e40-8754-709131aa7e04
fieldlabels.8b06c658-dfdb-4b1e-a091-a90e9451ed10
fieldlabels.8a8de623-a854-476b-b9a8-8686b07d0b85
fieldlabels.642a0272-168f-4dd3-abb9-3780e6fdd804'
in /home/username/Projects/craft-wet/vendor/craftcms/cms/src/db/MigrationManager.php:256
Stack trace:
#0 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/InstallController.php(161): craft\db\MigrationManager->migrateUp(Object(craft\migrations\Install))
#1 [internal function]: craft\console\controllers\InstallController->actionCraft()
#2 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#5 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#6 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#7 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('install', Array)
#8 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('install', Array)
#9 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/controllers/SetupController.php(124): craft\console\Application->runAction('install')
#10 [internal function]: craft\console\controllers\SetupController->actionIndex()
#11 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#14 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Controller.php(199): yii\console\Controller->runAction('', Array)
#15 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
#16 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('setup', Array)
#17 /home/username/Projects/craft-wet/vendor/craftcms/cms/src/console/Application.php(93): yii\console\Application->runAction('setup', Array)
#18 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('setup', Array)
#19 /home/username/Projects/craft-wet/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#20 /home/username/Projects/craft-wet/craft(22): yii\base\Application->run()
#21 {main}

Other information