robuust / craft-reverserelations

Reverse Relations for Craft
MIT License
12 stars 15 forks source link

Unable to 'Disabled' an entry that contains a reverse field #9

Closed jesuismaxime closed 4 years ago

jesuismaxime commented 5 years ago

When I try to disable an entry that contains a ReverseRelations field, I got a 500 with this trace (relatedResults is my field handle):

yii\base\ErrorException: Trying to get property 'relatedResults' of non-object in /[...]/vendor/robuust/craft-reverserelations/src/fields/ReverseEntries.php:141
Stack trace:
#0 /[...]/vendor/craftcms/cms/src/web/ErrorHandler.php(81): yii\base\ErrorHandler->handleError(8, 'Trying to get p...', '/[...]/...', 141)
#1 /[...]/vendor/robuust/craft-reverserelations/src/fields/ReverseEntries.php(141): craft\web\ErrorHandler->handleError(8, 'Trying to get p...', '/[...]/...', 141, Array)
#2 /[...]/vendor/craftcms/cms/src/base/Element.php(1862): robuust\reverserelations\fields\ReverseEntries->beforeElementSave(Object(craft\elements\Entry), false)
#3 /[...]/vendor/craftcms/cms/src/elements/Entry.php(1118): craft\base\Element->beforeSave(false)
#4 /[...]/vendor/craftcms/cms/src/services/Elements.php(410): craft\elements\Entry->beforeSave(false)
#5 /[...]/vendor/craftcms/cms/src/controllers/EntriesController.php(553): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#6 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#7 /[...]/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /[...]/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /[...]/vendor/craftcms/cms/src/web/Controller.php(109): yii\base\Controller->runAction('save-entry', Array)
#10 /[...]/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#11 /[...]/vendor/craftcms/cms/src/web/Application.php(297): yii\base\Module->runAction('entries/save-en...', Array)
#12 /[...]/vendor/craftcms/cms/src/web/Application.php(565): craft\web\Application->runAction('entries/save-en...', Array)
#13 /[...]/vendor/craftcms/cms/src/web/Application.php(281): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#14 /[...]/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#15 /[...]/web/index.php(21): yii\base\Application->run()
#16 {main}
boboldehampsink commented 5 years ago

Which version are you using?

boboldehampsink commented 4 years ago

Fixed in 1.1.6