Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#60878 new defect (bug)

We need to add trim validation on Add New Category name

Reported by: sumitsingh's profile sumitsingh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-screenshots has-patch has-testing-info needs-testing
Focuses: ui, administration Cc:

Description

Hey Team,

Today I have just by mistake added space then validation is not working. So I can suggest using the trim function to remove space things too?

Bug Report

Description

Describe the bug.

Environment

  • WordPress: 6.5-RC4
  • PHP: 7.4.3-4ubuntu2.20
  • Server: Apache/2.4.41 (Ubuntu)
  • Database: mysqli (Server: 8.0.36-0ubuntu0.20.04.1 / Client: mysqlnd 7.4.3-4ubuntu2.20)
  • Browser: Chrome 116.0.0.0 (Linux)
  • Theme: Twenty Eleven 4.5
  • MU-Plugins: None activated
  • Plugins:
    • Advanced Custom Fields PRO 6.0.7
    • Elementor 3.17.3
    • Favorites Any Post 1.0.0
    • React Post Listing 1.0.0
    • Simple Custom Post Order 2.5.7
    • WooCommerce 8.3.1
    • WooPayments 6.8.0
    • WordPress Beta Tester 3.5.5

Steps to Reproduce

  1. GO to Add New Category
  2. add space on the Category name then click on the "Add New Category" button
  3. 🐞 Bug occurs.

Expected Results

  1. ✅ should be an error even if only added space on the field

Actual Results

  1. ❌ an error even added only space on the field

adding quick recording too.

Attachments (4)

Categories ‹ wp-extended — WordPress.mp4 (864.7 KB) - added by sumitsingh 4 months ago.
Categories-‹-wp-extended-—-WordPress.png (207.8 KB) - added by sumitsingh 4 months ago.
error message i can see but input box is not hilighting when adding space
2024-04-02 17-51-34.mkv (3.3 MB) - added by pratiklondhe 4 months ago.
Tested the patch
vlLu4AMQR2WRJ_jXsXaeCg.png (172.7 KB) - added by pratiklondhe 4 months ago.

Change History (10)

@sumitsingh
4 months ago

error message i can see but input box is not hilighting when adding space

This ticket was mentioned in PR #6343 on WordPress/wordpress-develop by swapnilghone.


4 months ago
#1

  • Keywords has-patch added

Added trim validation to Add new category name

Fixes: https://core.trac.wordpress.org/ticket/60878

This ticket was mentioned in Slack in #core-test by ankit-k-gupta. View the logs.


4 months ago

#3 @Ankit K Gupta
4 months ago

  • Keywords has-testing-info needs-testing added

#4 @swissspidy
4 months ago

  • Component changed from Posts, Post Types to Taxonomy
  • Focuses accessibility javascript removed
  • Version trunk deleted

@pratiklondhe
4 months ago

Tested the patch

#5 @pratiklondhe
4 months ago

Test Report

This report validates that the indicated patch addresses the issue.
Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/6343.diff

Environment

  • OS: macOS 14.3.1
  • Web Server: Nginx
  • PHP: 8.1.9
  • WordPress: 6.5-RC4
  • Browser: Chrome 123.0.0.0 (macOS)
  • Theme: Twenty Twenty-Four

Actual Results

  • ✅ Input box now gets highlighted even when adding space

Supplemental Artifacts

https://core.trac.wordpress.org/attachment/ticket/60878/2024-04-02%2017-51-34.mkv
https://prnt.sc/P-DmgDcZaRWb

#6 @Hitendra Chopda
3 months ago

Test report


I have tested the patch below.

https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/6343.diff

Environment

  • OS: macOS Sonoma 14.4
  • Web Server: Nginx
  • PHP: 8.3
  • WordPress: 6.6-alpha-20240402.091906
  • Browser: Safari 7.4 (macOS), Chrome Version 123.0.6312.106
  • Theme: Twenty Twenty-Four 1.1

Screenshot: https://share.cleanshot.com/LfpJsYqRZhx1fqq8mXp0

Actual Result:

  • Input box now gets highlighted even when adding space in the name.

Thank you.

Last edited 3 months ago by Hitendra Chopda (previous) (diff)
Note: See TracTickets for help on using tickets.