craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.22k stars 627 forks source link

[4.x]: Temporary uploads listing give 500 #11192

Closed ishitatsuyuki closed 2 years ago

ishitatsuyuki commented 2 years ago

What happened?

Description

The temporary uploads listing gives 500 if the "Temp Uploads Location" is configured as "Local Temp Folder".

Steps to reproduce

  1. Upload an image to temporary uploads
  2. Refresh to load listing

Expected behavior

The listing loads with thumbnails

Actual behavior

2022-05-11 03:20:37 [web.ERROR] [TypeError] TypeError: craft\services\Fs::getFilesystemByHandle(): Argument #1 ($handle) must be of type string, null given, called in /var/www/html/vendor/craftcms/cms/src/models/Volume.php on line 276 and defined in /var/www/html/vendor/craftcms/cms/src/services/Fs.php:139
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/models/Volume.php(276): craft\services\Fs->getFilesystemByHandle(NULL)
#1 /var/www/html/vendor/craftcms/cms/src/services/Assets.php(602): craft\models\Volume->getTransformFs()
#2 /var/www/html/vendor/craftcms/cms/src/elements/Asset.php(1601): craft\services\Assets->getThumbUrl(Object(craft\elements\Asset), 34, 34)
#3 /var/www/html/vendor/craftcms/cms/src/helpers/Cp.php(280): craft\elements\Asset->getThumbUrl(34)
#4 /var/www/html/vendor/craftcms/cms/src/web/View.php(2155): craft\helpers\Cp::elementHtml(Object(craft\elements\Asset), 'index', 'small', NULL, false, true, true, true, false, false)
#5 /var/www/html/vendor/craftcms/cms/src/web/View.php(1704): craft\web\View->_getCpElementHtml(Array, false)
#6 /var/www/html/storage/runtime/compiled_templates/26/261a5ea2d56b14ae8c15588ae38ec498.php(38): craft\web\View->invokeHook('cp.elements.ele...', Array)
#7 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_27c21bb39e63ae35cb6b729d5c5f0b62->doDisplay(Array, Array)
#8 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#9 /var/www/html/storage/runtime/compiled_templates/e6/e67ba71cd6a69f6eb5d7b9e6deb4f07a.php(155): Twig\Template->display(Array)
#10 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_580d2a51d9240e9c11ff601aff523b62->doDisplay(Array, Array)
#11 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#12 /var/www/html/storage/runtime/compiled_templates/60/6059a3747f798086024b34f6516d0845.php(127): Twig\Template->display(Array)
#13 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_35e3df0f8f29f61a75741df3db40d262->doDisplay(Array, Array)
#14 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#15 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#16 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render(Array, Array)
#17 /var/www/html/vendor/twig/twig/src/Environment.php(277): Twig\TemplateWrapper->render(Array)
#18 /var/www/html/vendor/craftcms/cms/src/web/View.php(414): Twig\Environment->render('_elements/table...', Array)
#19 /var/www/html/vendor/craftcms/cms/src/base/Element.php(999): craft\web\View->renderTemplate('_elements/table...', Array)
#20 /var/www/html/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(644): craft\base\Element::indexHtml(Object(craft\elements\db\AssetQuery), Array, Array, 'folder:9524cb92...', 'index', true, false)
#21 /var/www/html/vendor/craftcms/cms/src/controllers/ElementIndexesController.php(142): craft\controllers\ElementIndexesController->elementResponseData(true, true)
#22 [internal function]: craft\controllers\ElementIndexesController->actionGetElements()
#23 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#24 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#25 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('get-elements', Array)
#26 /var/www/html/vendor/craftcms/cms/src/web/Application.php(301): yii\base\Module->runAction('element-indexes...', Array)
#27 /var/www/html/vendor/craftcms/cms/src/web/Application.php(625): craft\web\Application->runAction('element-indexes...', Array)
#28 /var/www/html/vendor/craftcms/cms/src/web/Application.php(280): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#29 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#30 /var/www/html/web/index.php(12): yii\base\Application->run()

Craft CMS version

4.0.1

PHP version

8.1.5

Operating system and version

Linux

Database type and version

MariaDB 10.3

Image driver and version

No response

Installed plugins and versions

No plugins

brandonkelly commented 2 years ago

I’m not entirely sure how this happened. Can you please send a database backup and your Composer files over to support@craftcms.com? We can look into it from there.

ishitatsuyuki commented 2 years ago

Thank you!

brandonkelly commented 2 years ago

Craft 4.0.2 is out now with a fix for this. Thanks for the help!