ryssbowh / craft-activity

Other
4 stars 0 forks source link

Error saving Control Panel CSS #27

Closed mlebarron closed 1 month ago

mlebarron commented 1 month ago

We have the Control Panel CSS plugin just for some simple theming on the login panel. When trying to modify the "Additional CSS" field, this error is thrown.

yii\base\ErrorException: Undefined array key "edition" in /var/www/html/vendor/ryssbowh/craft-activity/src/recorders/Plugins.php:51
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError()
#1 /var/www/html/vendor/ryssbowh/craft-activity/src/recorders/Plugins.php(51): craft\web\ErrorHandler->handleError()
#2 /var/www/html/vendor/ryssbowh/craft-activity/src/recorders/Plugins.php(28): Ryssbowh\Activity\recorders\Plugins->onChanged()
#3 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(1179): Ryssbowh\Activity\recorders\Plugins->Ryssbowh\Activity\recorders\{closure}()
#4 [internal function]: craft\services\ProjectConfig->handleChangeEvent()
#5 /var/www/html/vendor/yiisoft/yii2/base/Component.php(641): call_user_func()
#6 /var/www/html/vendor/craftcms/cms/src/models/ProjectConfigData.php(85): yii\base\Component->trigger()
#7 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(1169): craft\models\ProjectConfigData->commitChanges()
#8 [internal function]: craft\services\ProjectConfig->handleChangeEvent()
#9 /var/www/html/vendor/yiisoft/yii2/base/Component.php(641): call_user_func()
#10 /var/www/html/vendor/craftcms/cms/src/models/ProjectConfigData.php(85): yii\base\Component->trigger()
#11 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(564): craft\models\ProjectConfigData->commitChanges()
#12 /var/www/html/vendor/craftcms/cms/src/services/ProjectConfig.php(524): craft\services\ProjectConfig->_setInternal()
#13 /var/www/html/vendor/craftcms/cms/src/services/Plugins.php(741): craft\services\ProjectConfig->set()
#14 /var/www/html/vendor/craftcms/cms/src/controllers/PluginsController.php(160): craft\services\Plugins->savePluginSettings()
#15 [internal function]: craft\controllers\PluginsController->actionSavePluginSettings()
#16 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#17 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#18 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#19 /var/www/html/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction()
#20 /var/www/html/vendor/craftcms/cms/src/web/Application.php(649): craft\web\Application->runAction()
#21 /var/www/html/vendor/craftcms/cms/src/web/Application.php(312): craft\web\Application->_processActionRequest()
#22 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#23 /var/www/html/web/index.php(12): yii\base\Application->run()
#24 {main}
mlebarron commented 1 month ago

My first thought was I could have an ignore rule for Plugin Settings Changed. I tried this

Screenshot 2024-09-16 at 16 21 07

and I still receive the error.

ryssbowh commented 1 month ago

That's very strange, are you tracking your config through project config yaml files ? I can't reproduce this but I added a fix on 3.0.3 which should work for you

mlebarron commented 1 month ago

I am, I checked it with SEOMatic too, same thing. THere's a number of them that don't have edition but this does fix it. Thank you.

my project config for SEOMatic says

seomatic:
    enabled: '1'
    licenseKey: <LICENSE>
    schemaVersion: 3.0.12
    settings: null

Control Panel CSS

  cp-css:
    enabled: '1'
    licenseKey: null
    schemaVersion: 2.0.0
    settings:
      additionalCss: "body.login {\r\n  background: #101f2d;\r\n}\r\n\r\nbody.login label {\r\n  color: #fff;\r\n}\r\n\r\nbody.login .disabled {\r\n  opacity: .5;\r\n}"
      cssFile: ''