Closed croxton closed 5 months ago
Hi, thanks for reporting! I was able to replicate this (though not consistently). I raised a PR for this.
For future reference, to replicate this (not consistently), I did the following:
siteA
, siteB
)user1
, user2
)user1
in one browser, as user2
in another one (or private window)user1
, go to the entries index page for siteA
user2
, edit the entry for siteB
; make a change and click Save (not save and continue editing)ElementsController->actionRecentActivity()
, the $element
is a Response
Just released Craft 4.8.5 and 5.0.0-beta.11 with the fix for this. Thanks again!
hey @brandonkelly
We're seeing a similar thing when the elements/save-draft action is run, presumably when it tries to autosave? The site is running 4.10.5.
I'm not entirely sure how to reproduce it but I imagine it's similar to the convoluted aforementioned steps, as this is a multi site install with many editors.
2024-07-30 15:58:39 [web.ERROR] [yii\\base\\UnknownMethodException] Calling unknown method: craft\\web\\Response::getIsRevision()",
"#0 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(1342): yii\\base\\Component->__call('getIsRevision', Array)",
"#1 [internal function]: craft\\controllers\\ElementsController->actionSaveDraft()",
"#2 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)",
"#3 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams(Array)",
"#4 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction('save-draft', Array)",
"#5 /var/www/html/vendor/craftcms/cms/src/web/Application.php(340): yii\\base\\Module->runAction('elements/save-d...', Array)",
"#6 /var/www/html/vendor/craftcms/cms/src/web/Application.php(641): craft\\web\\Application->runAction('elements/save-d...', Array)",
"#7 /var/www/html/vendor/craftcms/cms/src/web/Application.php(302): craft\\web\\Application->_processActionRequest(Object(craft\\web\\Request))",
"#8 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest(Object(craft\\web\\Request))",
"#9 /var/www/html/public/index.php(12): yii\\base\\Application->run()",
"#10 {main}"
@charliegrinsted That should be fixed now for the next release.
To get the fix early, change your craftcms/cms
requirement in composer.json to:
"craftcms/cms": "4.x-dev as 4.10.7",
and then run composer update
.
Craft 4.10.8 is out with that fix. Thanks for reporting, @charliegrinsted!
@brandonkelly @i-just I've started to see regular occurrences of this error message since updating Craft recently. Here's the stack trace (apologies for the formatting):
Calling unknown method: craft\web\Response::getIsRevision() {"trace":["#0 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/craftcms/cms/src/controllers/ElementsController.php(1675): yii\\base\\Component->__call()","#1 [internal function]: craft\\controllers\\ElementsController->actionUpdateFieldLayout()","#2 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#3 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#4 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#5 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/craftcms/cms/src/web/Application.php(340): yii\\base\\Module->runAction()","#6 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/craftcms/cms/src/web/Application.php(639): craft\\web\\Application->runAction()","#7 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/craftcms/cms/src/web/Application.php(302): craft\\web\\Application->_processActionRequest()","#8 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#9 /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/public/index.php(12): yii\\base\\Application->run()","#10 {main}"],"memory":5153328,"exception":"[object] (yii\\base\\UnknownMethodException(code: 0): Calling unknown method: craft\\web\\Response::getIsRevision() at /home/removed/releases/0bec64af89ec999cee1d453404970c8c80c15d47/craft/vendor/yiisoft/yii2/base/Component.php:308)"}
I'm running 4.12.2
. Should I open a new ticket?
@jonleverrier - thanks for the stack trace. I raised a PR for this.
@jonleverrier Craft 4.12.3 and 5.4.4 are out with that fix.
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: https://github.com/craftcms/cms/blob/9d218d94f490e787e1c9f20ed9d2bd909a3bdfd2/src/controllers/ElementsController.php#L1790
Response from here: https://github.com/craftcms/cms/blob/9d218d94f490e787e1c9f20ed9d2bd909a3bdfd2/src/controllers/ElementsController.php#L1937
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