Hide author vertical tab when author field is hidden

Created on 5 January 2021, over 3 years ago
Updated 4 January 2024, 6 months ago

Problem/Motivation

Currently, if I create a Fragment type and then hide the Author field in the form display for that Fragment, on the add/edit form, it still shows an Author vertical tab.

Steps to reproduce

  1. Enable Fragments module
  2. Create fragment type
  3. Manage form display for new fragment type
  4. Move authoring field to 'hidden'
  5. Visit fragment type add form and click on the 'Authoring information' tab
  6. Note the empty tab

Proposed resolution

In Drupal\fragments\Form\FragmentForm::buildForm() add check before adding $form['authoring_information'] container as to whether $form['user_id'] is being rendered.

Remaining tasks

  • Create patch
  • Review, test, commit

User interface changes

In the case where the Author field is hidden, then the UI will change to no longer show the "Authoring information" vertical tab.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pyrello

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

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