verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

[C4]: Migration error after Beta2 > Beta3 update #292

Closed davidhellmann closed 2 years ago

davidhellmann commented 2 years ago

Description After I upgrade from Beta2 to Beta3 and run the migrations I get this error:

> update in {{%navigation_nodes}} ... done (time: 0.000s)
    > update in {{%navigation_nodes}} ... done (time: 0.000s)
Exception: Trying to access array offset on value of type null (/Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/verbb/navigation/src/services/Navs.php:282)
#0 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/verbb/navigation/src/services/Navs.php(282): yii\base\ErrorHandler->handleError(2, 'Trying to acces...', '/Users/david.he...', 282)
#1 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/services/ProjectConfig.php(1116): verbb\navigation\services\Navs->handleChangedNav(Object(craft\events\ConfigEvent))
#2 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#3 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/Component.php(633): call_user_func(Array, Object(craft\events\ConfigEvent))
#4 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/models/ProjectConfigData.php(82): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#5 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/services/ProjectConfig.php(1106): craft\models\ProjectConfigData->commitChanges(Array, Array, 'navigation.navs...')
#6 [internal function]: craft\services\ProjectConfig->handleChangeEvent(Object(craft\events\ConfigEvent))
#7 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/Component.php(633): call_user_func(Array, Object(craft\events\ConfigEvent))
#8 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/models/ProjectConfigData.php(82): yii\base\Component->trigger('updateItem', Object(craft\events\ConfigEvent))
#9 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/services/ProjectConfig.php(505): craft\models\ProjectConfigData->commitChanges(Array, Array, 'navigation.navs...', true, NULL, true)
#10 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/verbb/navigation/src/migrations/m220428_000000_custom_node_type.php(44): craft\services\ProjectConfig->set('navigation.navs...', Array)
#11 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/db/Migration.php(49): verbb\navigation\migrations\m220428_000000_custom_node_type->safeUp()
#12 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(758): craft\db\Migration->up()
#13 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/console/controllers/MigrateController.php(360): yii\console\controllers\BaseMigrateController->migrateUp('m220428_000000_...')
#14 [internal function]: craft\console\controllers\MigrateController->actionAll()
#15 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#16 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#17 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/console/Controller.php(182): yii\base\Controller->runAction('all', Array)
#18 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/Module.php(552): yii\console\Controller->runAction('all', Array)
#19 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#20 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/craftcms/cms/src/console/Application.php(90): yii\console\Application->runAction('migrate/all', Array)
#21 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('migrate/all', Array)
#22 /Users/david.hellmann/Development/Private/craftcms-baukasten/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest(Object(craft\console\Request))
#23 /Users/david.hellmann/Development/Private/craftcms-baukasten/craft(22): yii\base\Application->run()
#24 {main}
*** failed to apply m220428_000000_custom_node_type (time: 0.163s)

Additional info

engram-design commented 2 years ago

Think I might've fixed this already, are you able to update to the latest branch, change your verbb/navigation requirement in composer.json to:

"require": {
  "verbb/navigation": "dev-craft-4 as 2.0.0-beta.3",
  "...": "..."
}

Then run composer update.

davidhellmann commented 2 years ago

Looks much better! Thank you @engram-design :)

engram-design commented 2 years ago

Will keep open for the moment!

engram-design commented 2 years ago

Fixed in 2.0.0-beta.4