carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

the icon of a file-fieldtype with set_value_type("url") reverts to default after uploading a file and pressing "update"

Open bigmistqke opened this issue 3 years ago • 1 comments

Version

  • Carbon Fields: 3.3.4
  • WordPress: 5.9.3
  • PHP: 7.3.21

Expected Behavior

After uploading a file with the file-fieldtype and set_value_type( "url" ) the file-icon should remain image after pressing "update"

Actual Behavior

but instead it returns to its default state image

Container definition

Container::make( 'post_meta', 'files' )
  ->add_fields( array(
    Field::make( 'file', 'crb_files', 'files' )
    ->set_visible_in_rest_api( true )
    ->set_width( 10 )
    ->set_value_type( "url" )
  ));

Steps to Reproduce the Problem

  1. make the container definition
  2. upload the file
  3. press update

Comments

image the data does show up via the REST-api, so it's purely a cosmetical bug in the wordpress-editor. The bug does not occur when set_value_type is not set.

at the moment it only seems to happen with pdf-files, although a bit earlier i had the same bug happening with images too.

bigmistqke avatar May 20 '22 20:05 bigmistqke

Like mine, version 3.3.4, Filed image, file will not return images, the problem is the same as yours. Only Media Gallery is available.

faganer avatar Jun 02 '22 01:06 faganer

We couldn't reproduce the issue on the newest version (v3.5.0). Please update WordPress core and Carbon Fields to the newest version and let us know if the issues still exist.

HTMLBurger-NG avatar Feb 20 '23 09:02 HTMLBurger-NG