Do not create empty details on node form if user has no form field permissions

Created on 18 November 2022, over 2 years ago
Updated 10 June 2025, about 2 months ago

Problem/Motivation

Empty Comments details form element on node form leads to poor UX.

Steps to reproduce

Add a disqus comment field to a node with an 'advanced settings tabs-set' in its form display.

Access node form as a user without permissions 'toggle disqus comments' and 'administer disqus'.
Node form will have an empty 'Comments' details element within the 'advanced settings tabs-set'.

Proposed resolution

Check if user has access to either form field before adding a Comments detail elements.
I'll provide a patch below.

User interface changes

Empty Comments details form element on node form will no longer render.

📌 Task
Status

Fixed

Version

2.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
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.71.5 2024