Description
When there's only one file in an asset volume and the asset index of that volume is updated via Utilities>Asset Indexes, the assets index of that volume is not rebuilt correctly. For example, if that lone file is manually deleted (outside of the CP) and the asset index is updated, Craft doesn't detect the file is removed.
Normally, Craft would alert a missing file couldn't be found and asks if it should be deleted from the index. However, this prompt doesn't appear. In fact, an alert about .DS_Store not being able to be indexed appears (which would also be nice to get rid of).
If there's more than one file in the asset volume, reindexing works properly.
Steps to reproduce
- Upload one asset to an assets volume by CP
- Remove uploaded asset outside of CP
- Reindex the asset volume of where asset was uploaded via
Utilities>Asset Indexes
- Go to
Assets in CP, click on the asset volume. The removed asset still appears.
Additional info
- Craft version: 3.5.5
- PHP version: 7.4.5
- Database driver & version: MySQL 5.7.29
- Plugins & versions:
"aelvan/imager": "v2.4.0",
"anubarak/craft-relabel": "2.0.2",
"barrelstrength/sprout-encode-email": "^2.0.7",
"born05/craft-assetusage": "2.1.0",
"craftcms/aws-s3": "1.2.9",
"craftcms/cms": "3.5.5",
"craftcms/mailgun": "^1.4.2",
"craftcms/redactor": "2.7.1",
"doublesecretagency/craft-inventory": "2.1.0",
"experience/overflow": "2.0.0",
"mmikkel/retcon": "2.2.1",
"nystudio107/craft-cookies": "^1.1.12",
"nystudio107/craft-minify": "1.2.10",
"nystudio107/craft-seomatic": "3.3.16",
"nystudio107/craft-twigpack": "1.2.5",
"nystudio107/craft-twigprofiler": "^1.0.1",
"nystudio107/craft-typogrify": "^1.1.18",
"nystudio107/dotenvy": "^1.0",
"ostark/craft-plugin-commands": "^1.1",
"pennebaker/craft-architect": "2.3.3",
"putyourlightson/craft-blitz-recommendations": "^1.1.0",
"putyourlightson/craft-elements-panel": "^1.1.0",
"putyourlightson/craft-sprig": "1.0.0-beta.10",
"sebastianlenz/linkfield": "1.0.23",
"solspace/craft-express-forms": "1.0.6",
"studioespresso/craft-dumper": "2.0.0",
"studioespresso/craft-seeder": "3.2.0",
"vaersaagod/seomate": "^1.1.4",
"verbb/cp-nav": "3.0.13.1",
"verbb/expanded-singles": "1.1.3",
"verbb/image-resizer": "2.0.10",
"vlucas/phpdotenv": "^3.4.0",
"yiisoft/yii2-redis": "^2.0"