cp-nav icon indicating copy to clipboard operation
cp-nav copied to clipboard

Layout errors where project.yaml is out of sync

Open JayBox325 opened this issue 9 months ago • 1 comments

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

  1. Setup layouts locally
  2. Push up to staging server
  3. Running the php craft project-config/apply and 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

JayBox325 avatar Mar 10 '25 12:03 JayBox325

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".

engram-design avatar Mar 11 '25 03:03 engram-design

Updated in 5.0.5.

engram-design avatar Jul 18 '25 14:07 engram-design