Make WordPress Core

Opened 3 years ago

Last modified 18 months ago

#60878 new defect (bug)

We need to add trim validation on Add New Category name

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

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 3 years ago.
Categories-‹-wp-extended-—-WordPress.png​ (207.8 KB ) - added by sumitsingh 3 years 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 3 years ago.
Tested the patch
vlLu4AMQR2WRJ_jXsXaeCg.png​ (172.7 KB ) - added by pratiklondhe 3 years ago.

Change History (12)

@sumitsingh
3 years 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.


3 years 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.


3 years ago

#3 @Ankit K Gupta
3 years ago

  • Keywords has-testing-info needs-testing added

#4 @swissspidy
3 years ago

  • Component Posts, Post Types → Taxonomy
  • Focuses accessibility javascript removed
  • Version trunk

#5 @pratiklondhe
3 years 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 years 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 textbox.

Thank you.

Version 0, edited 3 years ago by Hitendra Chopda (next)

#7 @pratiklondhe
2 years ago

  • Keywords needs-testing removed

#8 @wordpressdotorg
18 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.