Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button "Add image" of image field throw error on option page #929

Open
antoine-paradigmes opened this issue Sep 23, 2024 · 1 comment
Open

Comments

@antoine-paradigmes
Copy link

Describe the bug
Button "Add image" of image field isn't working when added on an option page

To Reproduce
Steps to reproduce the behavior:

  1. Create an option page "option"
  2. Create an acf field group with an image field inside
  3. Associate the field group to the option page
  4. Go to the option page and click on "Add image" button
  5. Console is throwing an error :
Uncaught TypeError: Cannot read properties of undefined (reading 'align')
    at n.resetDisplays (media-views.min.js?ver=6.6.2:2:11778)
    at n.initialize (media-views.min.js?ver=6.6.2:2:11016)
    at h.Model (backbone.min.js?ver=1.5.0:2:4722)
    at n.constructor (media-views.min.js?ver=6.6.2:2:17303)
    at new n (backbone.min.js?ver=1.5.0:2:23777)
    at n.addFrameStates (acf-input.min.js?ver=6.3.6:1:83108)
    at n.initialize (acf-input.min.js?ver=6.3.6:1:82354)
    at n.e (acf.min.js?ver=6.3.6:1:3257)
    at acf.Model (acf.min.js?ver=6.3.6:1:3391)
    at n [as constructor] (acf.min.js?ver=6.3.6:1:6558)

Note : I have this behavior on multiple of my websites, but not those in php 7.
Note : The button work wells when the image field is associated to a page, or a post.

Expected behavior
I should be able tu use image field on options pages.

Screenshots or Video
Capture d’écran 2024-09-23 à 14 56 43

Code
acf-export-informations-fields.json
acf-export-option-page.json

Version Information:

  • WordPress Version 6.6.2
  • PHP Version 8.2
  • ACF Version 6.3.6
  • Browser Chrome 128.0.6613.138 or Safari Version 17.1

Additional context

I got just 2 other plugins activated :

  • Imagify 2.2.2
  • WP Migrate 2.6.13

I use with composer :

  • Timber 2.1.0 (twig for WordPress)
  • Palmiak/timber-acf-wp-blocks 1.15
@Mikewalker24
Copy link

I have the same issue. Also using Timber (1.16) and Palmiak/timber-acf-wp-blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants