cp-nav
cp-nav copied to clipboard
Layout errors where project.yaml is out of sync
Describe the bug
Hi, I'm not sure if this is a bug or user error, but I'm getting a layouts error on our staging server, but works fine locally.
2025-03-10 04:29:05 [console.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Trying to access array offset on value of type null in /app/vendor/verbb/cp-nav/src/services/Layouts.php:158
...
{"memory":40523984,"exception":"[object] (yii\\base\\ErrorException(code: 2): Trying to access array offset on value of type null at /app/vendor/verbb/cp-nav/src/services/Layouts.php:158)"}
Steps to reproduce
- Setup layouts locally
- Push up to staging server
- Running the
php craft project-config/applyand with the --force flag command on the staging site throws the error above
Craft CMS version
5.6.11
Plugin version
5.0.4
Multi-site?
No response
Additional context
No response
Hmm, that does seem a little strange as the data is coming from the Project Config changed layout event.
Fixed for the next release. To get this early, run composer require verbb/cp-nav:"dev-craft-5 as 5.0.4".
Updated in 5.0.5.