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

Custom Fields unable to be restored in Revisions after creating a new page.

Open dtracey-fi opened this issue 4 years ago • 0 comments

Version

  • Carbon Fields: 3.0
  • WordPress: 5.8.1
  • PHP: 7.4.20

Expected Behavior

Custom fields are not being restored when going back to a previous revision revision in WordPress after you create a new page. In some cases edits to custom fields aren't even being registered.

Actual Behavior

Custom fields should be restored when going back to a previous revision in WordPress after you create a new page. And any edit to any custom field should appear as a revision.

Container definition

Container::make( 'post_meta', 'Blocks' )
            ->where('post_type', '=', 'page')
            ->add_fields([
                Field::make( 'complex', 'ff_blocks', '' )
		    ->set_layout( 'tabbed-vertical' )
                    ->add_fields( 'videos', 'Videos', [
						Field::make( 'text', 'title', 'Title' ),
						Field::make( 'complex', 'video', '' )
							->add_fields([
								Field::make( 'image', 'image', 'Thumbnail Image' )
									->set_required( true )
									->set_width( 40 ),
								Field::make( 'text', 'url', 'Video Embed URL' )
									->set_attribute( 'type', 'url' )
									->set_required( true )
									->set_width( 60 )
						])
					] )
       		]);

Steps to Reproduce the Problem

  1. Create a new page.
  2. Add the block to the page in the block section at the bottom of the page.
  3. Save the page.
  4. Update the content on the block you added.
  5. Restore from the previous revision.

Comments

This system was created a while back, before Gutenberg was ready for production. If the issue is not resolvable that's fine, we may need to suggest to the client to upgrade the website to Gutenberg, we would just like confirmation before we do that, as it'll be a big job.

dtracey-fi avatar Oct 27 '21 23:10 dtracey-fi