AdvancedCustomFields / AdvancedCustomFields/acf
ACF image field crashes when selecting an image in WordPress 7.0
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When clicking the image picker button, it throws this error on the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'all')
at n.customizeFilters (acf-input.min.js?ver=6.7.1:871:49)
at h.Collection.<anonymous> (acf-input.min.js?ver=6.7.1:863:60)
at p (backbone.min.js?ver=1.6.1:2:3644)
at f (backbone.min.js?ver=1.6.1:2:3497)
at a (backbone.min.js?ver=1.6.1:2:692)
at e.trigger (backbone.min.js?ver=1.6.1:2:3380)
at StateMachine.<computed> [as trigger] (media-views.js?ver=7.0-beta3:6951:25)
at Region.trigger (media-views.js?ver=7.0-beta3:10408:21)
at Region.mode (media-views.js?ver=7.0-beta3:10310:8)
at Region.render (media-views.js?ver=7.0-beta3:10328:16)
To Reproduce
Steps to reproduce the behavior:
- Install ACF 6.7.1 on WordPress 7.0 beta 3
- Create a field group with an Image field assigned to post_type = product or post
- Open the product edit page and click the
Add Imagebutton - See the error thrown immediately, and you cannot select the image
Expected behavior
- The media picker should be shown
- Able to upload or select an image
Screenshots or Video
X
Code
Version Information:
- WordPress Version 7.0 beta 3
- PHP Version 8.4.1
- ACF Version ACF Free 6.7.1
- Browser [Brave]
Additional context
X
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure on the product or post edit page with WordPress 7.0 beta 3 and ACF 6.7.1, then inspect the ACF code corresponding to customizeFilters in acf-input.min.js and the media picker events shown in the stack trace. Done means the media picker opens without the undefined-property error and allows an image to be uploaded or selected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, wordpress
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100