\Drupal\shortcut\Controller\ShortcutSetController should validate shortcut name

Created on 19 October 2021, over 2 years ago
Updated 4 February 2023, over 1 year ago

Problem/Motivation

Currently it is possible to create shortcuts with empty name even though the name is a required base field.

Steps to reproduce

1. Copy shortcut link URL on any page.
It'll look like this.
/admin/config/user-interface/shortcut/manage/default/add-link-inline?link=admin/structure&name=Structure&token=903WdO2yQgvI1YJYdafbjZU4SzmDIUXL2XDqnUPUY8c

2. Remove name query parameter from it.

3. Open the link in a browser.

The following message should appear.

Added a shortcut for .

Proposed resolution

Call $shortcut->validate() method before saving the Shortcut entity.
Show violations as error messages.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
ShortcutΒ  β†’

Last updated about 1 month ago

  • Maintained by
  • πŸ‡΅πŸ‡°Pakistan @jibran
Created by

πŸ‡·πŸ‡ΊRussia Chi

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024