craftcms / cms

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

The Asset index utility chokes on folders with `.` in the name #7900

Closed angrybrad closed 3 years ago

angrybrad commented 3 years ago

Steps to reproduce

  1. On a fresh Craft install, create a new local Asset Volume (set the path to ./uploads, for example).
  2. On the file system, go to the uploads folder and create a foo.bar folder inside of it and make there is at least one image inside of it.
  3. In the control panel go to Utilities->Asset Indexes and run the utility.
  4. Notice the flash error.
2021-05-07 14:24:14 [-][1][-][error][craft\errors\AssetLogicException] craft\errors\AssetLogicException: The folder foo.bar/ does not exist in /app/vendor/craftcms/cms/src/services/AssetIndexer.php:493
Stack trace:
#0 /app/vendor/craftcms/cms/src/services/AssetIndexer.php(251): craft\services\AssetIndexer->_indexFileByIndexData(Object(craft\models\AssetIndexData), true, true)
#1 /app/vendor/craftcms/cms/src/controllers/UtilitiesController.php(220): craft\services\AssetIndexer->processIndexForVolume('7d1c58de-b3c9-4...', 1, true)
#2 [internal function]: craft\controllers\UtilitiesController->actionAssetIndexPerformAction()
#3 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /app/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#5 /app/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('asset-index-per...', Array)
#6 /app/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('asset-index-per...', Array)
#7 /app/vendor/craftcms/cms/src/web/Application.php(279): yii\base\Module->runAction('utilities/asset...', Array)
#8 /app/vendor/craftcms/cms/src/web/Application.php(582): craft\web\Application->runAction('utilities/asset...', Array)
#9 /app/vendor/craftcms/cms/src/web/Application.php(258): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#10 /app/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /app/web/index.php(30): yii\base\Application->run()
#12 {main}

Note that manually creating the foo.bar subfolder from the Asset index page in the control panel works fine.

Additional info

andris-sevcenko commented 3 years ago

Fixed for the next relase!

brandonkelly commented 3 years ago

Craft 3.6.14 is out now with this fix.