ostark / upper

Integrates Edge Caches like Fastly, KeyCDN, Cloudflare and Varnish with Craft.
MIT License
102 stars 22 forks source link

Exception when creating new category #9

Closed kbergha closed 6 years ago

kbergha commented 6 years ago

Hi.

After installing Upper, and trying to create some new categories, I get the following error message:

Getting unknown property: craft\elements\Category::sectionId

Full exception/stack:

2018-03-16 13:12:11 [192.168.10.1][93][f0i82gim7haivglpl7qcn5j8q4][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Getting unknown property: craft\elements\Category::sectionId in /home/vagrant/code/vendor/yiisoft/yii2/base/Component.php:154
Stack trace:
#0 /home/vagrant/code/vendor/craftcms/cms/src/base/Element.php(753): yii\base\Component->__get('sectionId')
#1 /home/vagrant/code/vendor/ostark/upper/src/EventRegistrar.php(199): craft\base\Element->__get('sectionId')
#2 /home/vagrant/code/vendor/ostark/upper/src/EventRegistrar.php(32): ostark\upper\EventRegistrar::handleUpdateEvent(Object(craft\events\ElementEvent))
#3 [internal function]: ostark\upper\EventRegistrar::ostark\upper\{closure}(Object(craft\events\ElementEvent))
#4 /home/vagrant/code/vendor/yiisoft/yii2/base/Event.php(310): call_user_func(Object(Closure), Object(craft\events\ElementEvent))
#5 /home/vagrant/code/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger('craft\\services\\...', 'afterSaveElemen...', Object(craft\events\ElementEvent))
#6 /home/vagrant/code/vendor/craftcms/cms/src/services/Elements.php(513): yii\base\Component->trigger('afterSaveElemen...', Object(craft\events\ElementEvent))
#7 /home/vagrant/code/vendor/craftcms/cms/src/controllers/CategoriesController.php(487): craft\services\Elements->saveElement(Object(craft\elements\Category))
#8 [internal function]: craft\controllers\CategoriesController->actionSaveCategory()
#9 /home/vagrant/code/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /home/vagrant/code/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /home/vagrant/code/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller->runAction('save-category', Array)
#12 /home/vagrant/code/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-category', Array)
#13 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(237): yii\base\Module->runAction('categories/save...', Array)
#14 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(445): craft\web\Application->runAction('categories/save...', Array)
#15 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(221): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#16 /home/vagrant/code/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /home/vagrant/code/web/index.php(28): yii\base\Application->run()
#18 {main}

Disabling the Upper-plugin make the exception go away.

As far as I can see, Upper doesn't handle category objects? There's at least nothing related to this in ELEMENT_PROPERTY_MAP or TAGPREFIX

Is there anything I can do to prevent this error? Thanks!

Versions: PHP 7.1.12 Craft Pro 3.0.0-RC15 Upper 1.3.0

ostark commented 6 years ago

Thanks for your report! Yes, It's not implemented yet. I try to fix it as soon as possible.

ostark commented 6 years ago

@kbergha please give the latest release (1.3.1) a try

kbergha commented 6 years ago

I'll try when it's available on packagist.

kbergha commented 6 years ago

Thank you very much. It now works just fine!

ostark commented 6 years ago

Cache invalidation works as well, as Categories are basically Structures.