craftcms / craftcms/cms

Image popup empty after renaming folder [4.x]:

Open
#11,817 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

expected behavior
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?

After renaming the asset folder the asset popup to select is empty.

Description

This is happening when the folder/subfolder it leads to is changed. I have included three photos; one showing the empty asset picker, one showing that there are in fact assets, and the last showing the assets in the folder structure.

Steps to reproduce
  1. Create an assets field with one location and assign it a subfolder. Example: header-images
  2. Add field to section
  3. Create an example page and fill in the asset field created in step one
  4. Go to the Assets section of the admin, right-click the subfolder header-images and choose rename
  5. Rename said subfolder to Header Images
  6. Return to created example page and try to select a new image for the asset field (you will notice it is empty now too)
Expected behavior

Be able to rename folders without this anomaly

Actual behavior

I have included three images to hopefully help better illustrate the problem. Please let me know if you need more information from me.

image image image
Craft CMS version

4.2.1.1 Pro Trial

PHP version

8.0.8

Operating system and version

macOS BigSlur | Local MAMP Pro

Database type and version

MySQL 5.7.34

Image driver and version

No response

Installed plugins and versions

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the listed steps in Craft CMS 4.2.1.1, focusing on an asset field restricted to the renamed subfolder. Inspect the asset picker and folder-renaming flow to determine why the renamed folder appears empty; done means existing assets remain selectable after the rename and the behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.