[wp-trac] [WordPress Trac] #45882: REST Block Renderer: Fails when using the Advanced > Additional CSS Class functionality

WordPress Trac noreply at wordpress.org
Wed Jan 9 15:16:52 UTC 2019


#45882: REST Block Renderer: Fails when using the Advanced > Additional CSS Class
functionality
--------------------------+-----------------------------
 Reporter:  akirk         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When creating a block with a `ServerSideRender` component and using the
 "Additional CSS Class" block option, the rendering breaks with this HTTP
 response:

 `{"code":"rest_invalid_param","message":"Invalid parameter(s):
 attributes","data":{"status":400,"params":{"attributes":"className is not
 a valid property of Object."}}}`

 The reason for this is that the Block Renderer just takes the list of
 default attributes and `className` is not one of them.

 I came across this when actually introducing another attribute via a
 `editor.BlockEdit` filter which adds an attribute to all blocks but there
 is no chance to tell the REST renderer about it.

 I first submitted this as
 https://github.com/WordPress/gutenberg/pull/13249

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45882>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list