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

Media gallery doest not appear for image field #1265

Open
MrZyr0 opened this issue Nov 22, 2024 · 3 comments
Open

Media gallery doest not appear for image field #1265

MrZyr0 opened this issue Nov 22, 2024 · 3 comments

Comments

@MrZyr0
Copy link

MrZyr0 commented Nov 22, 2024

Version

  • Carbon Fields: 3.6.5
  • WordPress: 6.7.1
  • PHP: 8.1.30

Expected Behavior

When I click on the button "Select Image" Screenshot 2024-11-22 at 11 00 18, the WordPress media gallery should appear

Actual Behavior

Clicking does nothing

Container definition

Block::make('images-grid', __('Images grid', 'example-com'))
    ->set_description(__('Massonery pictures grid', 'example-com'))
    ->set_category('media')
    ->set_icon('grid-view')
    ->set_keywords([__('massonery', 'example-com'), __('media', 'example-com'), __('pictures', 'example-com'), __('photos', 'example-com'), __('gallery', 'example-com'), __('slider', 'example-com')])
    ->set_mode('both')
    ->add_fields([
      Field::make('text', 'total_columns', __('Grid width', 'example-com'))
        ->set_attribute('type', 'number')
        ->set_attribute('min', 1)
        ->set_attribute('max', 12)
        ->set_default_value(4)
        ->set_help_text(__('Define the number of grid columns.', 'example-com')),
      Field::make('complex', 'masonry_images', __('Images', 'example-com'))
        ->add_fields(array(
          Field::make('image', 'image', __('Image', 'example-com'))
            ->set_type('image')
            ->set_value_type('url'),
          Field::make('text', 'columns', __('Columns size', 'example-com'))
            ->set_attribute('type', 'number')
            ->set_attribute('min', 1)
            ->set_attribute('max', 12)
            ->set_default_value(1)
            ->set_help_text(__('Indicate the space taken up by the image in width.', 'example-com')),
          Field::make('text', 'rows', __('Lines size', 'example-com'))
            ->set_attribute('type', 'number')
            ->set_attribute('min', 1)
            ->set_default_value(1)
            ->set_help_text(__('Indicate the space taken up by the image in height.', 'example-com'))
        ))
        ->set_min(1)
        ->set_help_text(__('Add images to fill the grid.', 'example-com')),
    ])

Steps to Reproduce the Problem

  1. Create new page
  2. Add the block
  3. Add an entry to the complex
  4. Try to select an image

Comments

D'après mes investigations, il y aurait un problème de déclaration de l'évènement car j'ai plusieurs sites sur le même environnement (déclaration Docker similaire avec le même thème, la même version de WordPress et les mêmes plugins sous la même version) et je n'ai pas la même fonction rattachée.
Pour le site ayant un bouton fonctionnel j'ai un() qui a du code exécutable, mais pour le site qui ne fonctionne pas j'ai noop() qui est une fonction vide.

Here is some screenshots from the devtool of my non working website :

Screenshot 2024-11-22 at 11 10 27 Screenshot 2024-11-22 at 11 10 48

Here is some screenshots from the devtool of my working website :

Screenshot 2024-11-22 at 11 12 54 Screenshot 2024-11-22 at 11 13 05

Videos

Actual Behavior

Screen.Recording.2024-11-22.at.11.15.21.mov

Expected Behavior

Screen.Recording.2024-11-22.at.11.16.44.mov
@MrZyr0
Copy link
Author

MrZyr0 commented Nov 22, 2024

I seem to have this problem on all fields that should open the media gallery.
Below is a video where I have the same problem with a media_gallery field.

Screen.Recording.2024-11-22.at.12.53.00-1.mov

@piterka
Copy link

piterka commented Nov 25, 2024

I have the same problem... @MrZyr0 were you able to fix this somehow?

@MrZyr0
Copy link
Author

MrZyr0 commented Nov 25, 2024

No, for now the only bypass is to change the values in the database.

The block is displayed despite everything, it is really only the opening of the gallery that poses a problem.

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