[wp-trac] [WordPress Trac] #64017: WordPress REST API returns 500 error when updating serialized meta with an unchanged value

WordPress Trac noreply at wordpress.org
Mon Sep 22 20:37:46 UTC 2025


#64017: WordPress REST API returns 500 error when updating serialized meta with an
unchanged value
-------------------------------+------------------------------
 Reporter:  wwccscorer         |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  REST API           |     Version:  6.8.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by wwccscorer):

 This is the code which I use to enter the values for the meta data
 {{{
 registerPlugin( 'event-controls', {
     render: () => {
         // Add your custom code here.
         const postType = useSelect(
             ( select ) => select( 'core/editor' ).getCurrentPostType(),
             []
         );

         const [ meta, setMeta ] = useEntityProp( 'postType', postType,
 'meta' );

         if ( 'event' !== postType ) {
             return null;
         }
         return (
                 <PluginDocumentSettingPanel
             title={ 'Event info' }
                 >
                 <VStack>
                 <InputControl
             label={ 'Event Date' }
             value={ meta?.event_date }
             placeholder={ 'YYYY-MM-DD' }
             onChange={ ( value ) => setMeta( {
                 ...meta,
                 event_date: value || null
             } ) }
                 />
                 <InputControl
             label={ 'Event start time' }
             value={ meta?.event_start_time }
             onChange={ ( value ) => setMeta( {
                 ...meta,
                 event_start_time: value || null
             } ) }
                 />
                 <InputControl
             label={ 'Course name' }
             placeholder={ 'Location-slug or title' }
             value={ meta?.course_name_slug }
             onChange={ ( value ) => setMeta( {
                 ...meta,
                 course_name_slug: value || null
             } ) }
                 />
                 </VStack>
                 </PluginDocumentSettingPanel>
         );
     }
 } );
 }}}
 This all works fine but when I click the save button on the editor page to
 save the whole page, if there are any unsaved changes I receive the 500
 error.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64017#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list