[wp-trac] [WordPress Trac] #54521: Taxonomy term quick edit does not save if taxonomy has non latin characters

WordPress Trac noreply at wordpress.org
Mon Dec 20 16:52:18 UTC 2021


#54521: Taxonomy term quick edit does not save if taxonomy has non latin characters
--------------------------------+-----------------------------
 Reporter:  panagiotis.synetos  |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  6.0
Component:  Taxonomy            |     Version:  5.8.2
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  administration
--------------------------------+-----------------------------

Comment (by panagiotis.synetos):

 Fixing one thing, causes another to break @SergeyBiryukov , which I found
 while writing the Unit Test.

 I'll try and come back with more info before the end of the week if
 needed, but long story short

 Inside class WP_Screen https://github.com/WordPress/wordpress-
 develop/blob/trunk/src/wp-admin/includes/class-wp-screen.php#L250 there is
 a sanitize happening on the ID (which on our case, it's the taxonomy slug)

 Sanitizing something that is called `wp_ελληνικό_tax` gets converted to
 `wp__tax` and hell breaks loose down the line,
 https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
 admin/includes/class-wp-terms-list-table.php#L572 , as
 `$this->screen->taxonomy` is empty, same for the `post_type` , ending up
 with this notice

 (I just run `phpunit --group ajax --filter Tests_Ajax_QuickEdit` so I
 don't have to wait for the whole suite to run when `npm run test:php` )


 {{{
 ..E                                                                 3 / 3
 (100%)

 Time: 00:01.547, Memory: 172.50 MB

 There was 1 error:

 1) Tests_Ajax_QuickEdit::test_term_quick_edit_non_latin_slug
 Trying to get property 'show_ui' of non-object

 /var/www/src/wp-admin/includes/class-wp-terms-list-table.php:585
 /var/www/src/wp-admin/includes/class-wp-list-table.php:1445
 /var/www/src/wp-admin/includes/class-wp-terms-list-table.php:345
 /var/www/src/wp-admin/includes/ajax-actions.php:2146
 /var/www/src/wp-includes/class-wp-hook.php:303
 /var/www/src/wp-includes/class-wp-hook.php:327
 /var/www/src/wp-includes/plugin.php:470
 /var/www/tests/phpunit/includes/testcase-ajax.php:265
 /var/www/tests/phpunit/tests/ajax/QuickEdit.php:150

 }}}

 I've commit the unit tests, demonstrating that everything works fine with
 taxonomies with latin characters and that it fails with non-
 latin/accented.

 Any suggestions on how to move forward?

 Thanks and have a good one

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


More information about the wp-trac mailing list