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

File typed field loose its preview with a pdf and after refreshing #1270

Open
MrZyr0 opened this issue Jan 16, 2025 · 0 comments
Open

File typed field loose its preview with a pdf and after refreshing #1270

MrZyr0 opened this issue Jan 16, 2025 · 0 comments

Comments

@MrZyr0
Copy link

MrZyr0 commented Jan 16, 2025

Version

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

Expected Behavior

When you fill in the “file type” field with a pdf file, the entry keep the preview with a file icon after refreshing the editor, just like when set the field : Image

Actual Behavior

When I refresh the editor, the preview just disappeared whereas the value is saved in db.

Image

Container definition

Container::make('post_meta', __('Press détails', 'aaa'))
    ->where('post_type', 'presses')
    ->add_fields([
      Field::make('image', 'crb_house_logo', __('House logo', 'aaa')),
      Field::make('text', 'crb_thumbnail_field_1', __('Upper text', 'aaa')),
      Field::make('text', 'crb_thumbnail_field_2', __('Below text', 'aaa')),
      Field::make('file', 'crb_file', __('File', 'aaa'))
        ->set_value_type('url'),
      Field::make('text', 'crb_link', __('Link', 'aaa')),
    ]);

Steps to Reproduce the Problem

  1. Create a file type field without type restrictions and with a value type to "url"
  2. Try to fill the field with a pdf file from the media gallery
  3. Refresh the editor
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

1 participant