Make WordPress Core

Opened 7 weeks ago

Last modified 13 days ago

#60916 assigned defect (bug)

Menu link validation

Reported by: nikitasolanki1812's profile nikitasolanki1812 Owned by: rcreators's profile rcreators
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch changes-requested
Focuses: javascript, administration Cc:

Description

When creating a custom menu link and failing to enter a URL, a validation display should appear.

https://drive.google.com/file/d/1lZ5MkEVrRNRj3Msql5BubWy-jPpP1d13/view

I added a custom link to the menu list, and when I remove the URL and save the menu, the validation does not display.

https://drive.google.com/file/d/1F0kSf0Vgl-bTowlKNg8vYciUNsSeV7Kb/view

Attachments (2)

60916.diff (4.3 KB) - added by akrocks 6 weeks ago.
Created patch adding URL validation to Custom Links menu section.
60916.1.diff (5.6 KB) - added by akrocks 6 weeks ago.
Added commit to replace spaces with tabs.

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


7 weeks ago

#2 @joedolson
7 weeks ago

  • Focuses accessibility removed
  • Milestone changed from Awaiting Review to 6.6
  • Owner set to rcreators
  • Status changed from new to assigned
  • Version 6.5 deleted

This isn't in itself an accessibility issue; consistency between the two fields doesn't impact different users differently.

This does call attention to the validation itself, however, which is not accessible, and I'll open a separate issue for that.

#3 @sabernhardt
7 weeks ago

  • Component changed from General to Menus
  • Keywords needs-patch added; changes-requested removed

@akrocks
6 weeks ago

Created patch adding URL validation to Custom Links menu section.

@akrocks
6 weeks ago

Added commit to replace spaces with tabs.

This ticket was mentioned in PR #6389 on WordPress/wordpress-develop by @akrocks.


6 weeks ago
#4

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/60916

## Description

  • This PR adds URL validation to the Custom Link menu items.

## Steps to reproduce Bug

  • If we try adding Custom Link with an empty URL in the Menu, We get a validation error & are not able to add Custom Link.

https://github.com/Pathan-Amaankhan/wordpress-develop/assets/63953699/80590807-8df8-45d6-9261-2ab8535e0fb3

  • But if we try the same after adding Custom Link to the Menu, we don't get the validation error & can add Custom Link with an empty URL. This breaches the consistency.

https://github.com/Pathan-Amaankhan/wordpress-develop/assets/63953699/e36f3b2b-09be-4db4-9baa-81346756f2e8

## Expected behaviour

  • A validation error should be shown if we add Custom Link with an empty URL.

## Screenshots/Screencasts

#### Before

  • Able to save Custom Link with an empty URL.

https://github.com/Pathan-Amaankhan/wordpress-develop/assets/63953699/e36f3b2b-09be-4db4-9baa-81346756f2e8

#### After

  • A validation error is displayed if we try to save Custom Link with an empty URL.

https://github.com/Pathan-Amaankhan/wordpress-develop/assets/63953699/11e32112-096a-46eb-afee-efb134a5dd8d

---

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@rcreators commented on PR #6389:


2 weeks ago
#5

@Pathan-Amaankhan Can you make the changes as per suggestions? That will be great.

#6 @rcreators
13 days ago

  • Keywords changes-requested added
Note: See TracTickets for help on using tickets.