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

[4.x]: Image editor doesn't work for filesystems without URLs #11687

Closed
mmikkel opened this issue Jul 25, 2022 · 1 comment
Closed

[4.x]: Image editor doesn't work for filesystems without URLs #11687

mmikkel opened this issue Jul 25, 2022 · 1 comment

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Jul 25, 2022

What happened?

Description

This is likely related to #11686 as it seems like the same underlying error occurring:

When opening the image editor, either via the element index action "Edit Image" or via the "Edit" button on top of the image thumbnail in slideouts and edit pages, the image editor opens but the image never loads. There is no visible error message, but the browser's dev tools console reveals a 500 error from the assets/edit-image action, with the following exception:

TypeError: craft\services\Assets::getImagePreviewUrl(): Return value must be of type string, null returned in /path/to/project/vendor/craftcms/cms/src/services/Assets.php:669
Stack trace:
#0 /path/to/project/vendor/craftcms/cms/src/controllers/AssetsController.php(816): craft\services\Assets->getImagePreviewUrl(Object(craft\elements\Asset), 2622, 2622)
#1 [internal function]: craft\controllers\AssetsController->actionEditImage()
#2 /path/to/project/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /path/to/project/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /path/to/project/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('edit-image', Array)
#5 /path/to/project/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('assets/edit-ima...', Array)
#6 /path/to/project/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('assets/edit-ima...', Array)
#7 /path/to/project/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 /path/to/project/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /path/to/project/web/index.php(12): yii\base\Application->run()

Steps to reproduce

  1. Create a volume, and attach a filesystem with the "Files in this filesystem have public URLs" setting disabled to it
  2. Upload an image to the volume
  3. Open the image editor for the image, either from the assets element index action "Edit Image" or via the "Edit" button in the slideout or edit page

Expected behavior

Image editing fun.

Actual behavior

No fun.

Craft CMS version

4.1.4.1

PHP version

8.1.8

Operating system and version

macOS 12.4, Edge 103.0.1264.62 (Official build) (arm64)

Database type and version

MariaDB 10.8.3

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.0-29)

Installed plugins and versions

None

@brandonkelly
Copy link
Member

This is fixed alongside #11686 for the next release!

brandonkelly added a commit that referenced this issue Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants