[wp-trac] [WordPress Trac] #58109: Fatal Error when changed Taxonomy from hierarchical False to True

WordPress Trac noreply at wordpress.org
Mon Apr 10 07:30:26 UTC 2023


#58109: Fatal Error when changed Taxonomy from hierarchical False to True
----------------------------------------------+----------------------------
 Reporter:  narenin                           |      Owner:  (none)
     Type:  defect (bug)                      |     Status:  new
 Priority:  normal                            |  Milestone:  Awaiting
                                              |  Review
Component:  Taxonomy                          |    Version:  6.2
 Severity:  normal                            |   Keywords:
  Focuses:  administration, coding-standards  |
----------------------------------------------+----------------------------
 When we changed hierarchical False to True for Taxonomy then we received
 Fatal Error.


 {{{
 taxonomy_meta_box_sanitize_cb_checkboxes
 [11:39 AM] Uncaught exception 'TypeError' with message 'array_map():
 Argument #2 ($array) must be of type array, string given' in /var/www/wp-
 admin/includes/post.php:2091
 }}}



 This is happening because of **taxonomy_meta_box_sanitize_cb_checkboxes**
 function. This function not has the checked if the **$term** is array or
 not which is causing fatal error.

 We can use is_array condition for this like already done in
 **taxonomy_meta_box_sanitize_cb_input** function.

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


More information about the wp-trac mailing list