craftcms / craftcms/cms

Category field: Able to select multiple when limited to only one selection

Open
#1,847 6 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity:minor
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

When you have a category field and a limit to select only one category for an entry, then it is still possible to select multiple categories (using shift + click or cmd + click or ctrl+click), although only one will actually be used when clicking the button to use the selected categories

Steps to reproduce
  1. Add a category field to an entry that is limited for 1 category selection
  2. Select multiple categories by using shift + click or cmd + click (on windows ctrl + click)
  3. Now click the bottom right button in the popup to use the selected categories
  4. Only one of the selected categories will be used in the entry.
Additional info
  • Craft version: 3.0.0-beta.21 - 2017-07-07
  • PHP version: 7.0.15
  • Database driver & version: Mysql version 5.6.35
  • Plugins & versions: No plugins

Step 2 - Selected two categories:
schermafbeelding 2017-07-13 om 13 59 19

Step 4 - Only the category "PLAY" is used:
schermafbeelding 2017-07-13 om 13 57 32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with a category field limited to one selection, using shift-click, cmd-click, or ctrl-click to select multiple categories. The fix is complete when the selection UI prevents multiple categories in this mode and the entry uses the single selected category as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.