craftcms / craftcms/cms

“Add category” - button selectable (not hidden) when branch limit has been met

Open
#2,423 15 comments 21 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

The “add a category” button is displayed when it should be disabled (or ideally hidden) when the “branch limit” is set to “1” and a category has already been selected.

Steps to reproduce
  1. Create a category field, point to your category source and set the branch limit to 1
  2. Create a new section and add the new category field
  3. Create a new entry in the section
  4. Select a category
  5. The “add a category” button is still selectable (should be hidden) as the branch limit has been met.

The behaviour should mimic the “add asset” button which is hidden when the number of selected images matches the limit set for the field.

Additional info
  • Craft version: RC9
  • PHP version: 7.0.27
  • Database driver & version: MySQL 5.7.21

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

Reproduce the category-field behavior with branch limit 1, then compare it with the add-asset control described in the issue. Trace the category field's add-category control and verify that it becomes hidden or disabled after one category is selected; add or run a regression test if the existing field tests cover this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
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.