craftcms / craftcms/cms

[5.x]: Hide sidebar if only one entry section is available

Open
#16,966 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What happened?
Description

I have an entry selection field that has multiple sections available, but due to user permissions, only one is available. Meaning the sidebar is now redundant and shouldn't be displayed as only one item is available.

Steps to reproduce
  1. Add an entries field
  2. Select multiple sections
  3. Restrict user permissions to only make one of those sections available
  4. See needless sidebar
Expected behavior

The sidebar should not be visible as it's redundant and takes up a lot of space.

Actual behavior
Craft CMS version

5.6.13

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

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 issue in Craft CMS 5.6.13 by creating an entries field with multiple sections and restricting permissions so only one remains available. Inspect the entry selection field and sidebar behavior; done means the sidebar is hidden when exactly one section is available while remaining visible for multiple sections.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.