What happened?
Description
Error thrown when saving an entry and returning to the entry listing screen (I think).
Steps to reproduce
I didn't notice any errors reported in the control panel, but happened to spot the error in the log a few seconds after editing an entry.
2024-03-20 12:09:14 [web.ERROR] [yii\base\UnknownMethodException] Calling unknown method: craft\web\Response::getIsRevision()
#0 [/var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(1790):](https://github.com/craftcms/cms/tree/4.8.4/src/controllers/ElementsController.php#L1790) yii\base\Component->__call('getIsRevision', Array)
#1 [internal function]: craft\controllers\ElementsController->actionRecentActivity()
#2 [/var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57):](https://github.com/yiisoft/yii2/tree/2.0.48.1/framework/base/InlineAction.php#L57) call_user_func_array(Array, Array)
#3 [/var/www/html/vendor/yiisoft/yii2/base/Controller.php(178):](https://github.com/yiisoft/yii2/tree/2.0.48.1/framework/base/Controller.php#L178) yii\base\InlineAction->runWithParams(Array)
#4 [/var/www/html/vendor/yiisoft/yii2/base/Module.php(552):](https://github.com/yiisoft/yii2/tree/2.0.48.1/framework/base/Module.php#L552) yii\base\Controller->runAction('recent-activity', Array)
#5 [/var/www/html/vendor/craftcms/cms/src/web/Application.php(341):](https://github.com/craftcms/cms/tree/4.8.4/src/web/Application.php#L341) yii\base\Module->runAction('elements/recent...', Array)
#6 [/var/www/html/vendor/craftcms/cms/src/web/Application.php(642):](https://github.com/craftcms/cms/tree/4.8.4/src/web/Application.php#L642) craft\web\Application->runAction('elements/recent...', Array)
#7 [/var/www/html/vendor/craftcms/cms/src/web/Application.php(303):](https://github.com/craftcms/cms/tree/4.8.4/src/web/Application.php#L303) craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 [/var/www/html/vendor/yiisoft/yii2/base/Application.php(384):](https://github.com/yiisoft/yii2/tree/2.0.48.1/framework/base/Application.php#L384) craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /var/www/html/web/index.php(12): yii\base\Application->run()
#10 {main}
The bug is happening here:
|
if (!$element || $element->getIsRevision()) { |
Response from here:
|
return $this->redirect($element->getCpEditUrl()); |
So it's missing a check in the controller to see if the response from _element() is a web responses, and if it is, return it directly. (This is according to mattgrayisok)
Craft CMS version
4.8.4
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
What happened?
Description
Error thrown when saving an entry and returning to the entry listing screen (I think).
Steps to reproduce
I didn't notice any errors reported in the control panel, but happened to spot the error in the log a few seconds after editing an entry.
The bug is happening here:
cms/src/controllers/ElementsController.php
Line 1790 in 9d218d9
Response from here:
cms/src/controllers/ElementsController.php
Line 1937 in 9d218d9
So it's missing a check in the controller to see if the response from _element() is a web responses, and if it is, return it directly. (This is according to mattgrayisok)
Craft CMS version
4.8.4
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response