Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1.1]: Calling unknown method: craft\web\Response::getIsDraft() #15724

Closed
hatyi opened this issue Sep 12, 2024 · 2 comments
Closed

[5.1.1]: Calling unknown method: craft\web\Response::getIsDraft() #15724

hatyi opened this issue Sep 12, 2024 · 2 comments
Labels

Comments

@hatyi
Copy link

hatyi commented Sep 12, 2024

What happened?

Description

I'm trying to save a variant in Craft and sometimes I'm facing this error, it shows up as a flash message in the bottom left corner and it prevents the variant from being saved.
If the error happens I can't discard the unsaved changes either.

Steps to reproduce

  1. Difficult to say, try saving variants.
  2. If the error pops up, I can't even discard the changes.

Expected behavior

Variant is updated or the changes are discarded.

Actual behavior

Screenshot from 2024-09-12 10-45-59
Screenshot from 2024-09-12 10-46-27

Stack trace

2024-09-12 10:41:26 [web.ERROR] [yii\base\UnknownMethodException] yii\base\UnknownMethodException: Calling unknown method: craft\web\Response::getIsDraft() in /var/www/html/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(1637): yii\base\Component->__call('getIsDraft', Array)
#1 [internal function]: craft\controllers\ElementsController->actionApplyDraft()
#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('apply-draft', Array)
#5 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('elements/apply-...', Array)
#6 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('elements/apply-...', Array)
#7 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): 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/web/index.php(12): yii\base\Application->run()
#10 {main} {"memory":4796984,"exception":"[object] (yii\base\UnknownMethodException(code: 0): Calling unknown method: craft\web\Response::getIsDraft() at /var/www/html/vendor/yiisoft/yii2/base/Component.php:300)"}

Craft CMS version

5.1.1

PHP version

PHP 8.2.22 (cli)

Operating system and version

Ubuntu 22.04 (running PHP FPM, Nginx, MySQL in Docker)

Database type and version

mysql:8.0.36

Image driver and version

No response

Installed plugins and versions

{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "algolia/algoliasearch-client-php": "^3.4",
    "craftcms/ckeditor": "^4.0.4",
    "craftcms/cms": "5.1.1",
    "craftcms/commerce": "5.0.3",
    "mmikkel/incognito-field": "2.0.0",
    "nystudio107/craft-vite": "^5.0.0",
    "presseddigital/linkit": "5.0.0",
    "putyourlightson/craft-sendgrid": "3.0.0",
    "studioespresso/craft-scout": "5.0.1",
    "tecnickcom/tcpdf": "^6.7",
    "verbb/formie": "3.0.0-beta.13",
    "verbb/navigation": "3.0.0",
    "verbb/wishlist": "3.0.1",
    "vlucas/phpdotenv": "^5.4.0",
    "yiisoft/yii2-redis": "^2.0"
  },
  "require-dev": {
    "craftcms/generator": "^2.0.0",
    "yiisoft/yii2-shell": "^2.0.3"
  },
  "autoload": {
    "psr-4": {
      "lyskomponenter\\": "modules/lyskomponenter"
    }
  },
  "config": {
    "allow-plugins": {
      "craftcms/plugin-installer": true,
      "yiisoft/yii2-composer": true
    },
    "sort-packages": true,
    "optimize-autoloader": true,
    "platform": {
      "php": "8.2"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example.dev', '.env');\""
    ]
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://composer.craftcms.com",
      "canonical": false
    }
  ]
}
@hatyi hatyi added the bug label Sep 12, 2024
@hatyi
Copy link
Author

hatyi commented Sep 12, 2024

I saw that even though I have started the development of this project only a few months ago I'm already way behind the current stable version..
So I'll try to update everything in the upcoming days and close / follow-up on the issue if it disappears.

@hatyi hatyi changed the title [5.x]: Calling unknown method: craft\web\Response::getIsDraft() [5.1.1]: Calling unknown method: craft\web\Response::getIsDraft() Sep 12, 2024
@i-just
Copy link
Contributor

i-just commented Sep 13, 2024

Hi, I believe this was fixed in version 5.1.9 (via #15134).

I’ll close this now, but feel free to reach out again if the issue persists after the update.

@i-just i-just closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants