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.

Issue fork fragments-3191038

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pyrello created an issue. See original summary.

eelkeblok’s picture

Category: Feature request » Bug report
eelkeblok’s picture

Title: Detect whether Author field is hidden in form display » Hide author vertical tab when author field is hidden
eelkeblok’s picture

Version: 8.x-1.x-dev » 2.x-dev

eelkeblok’s picture

Status: Active » Needs review
eelkeblok’s picture

I guess there won't be a review.. :)

  • eelkeblok committed 261bec14 on 2.x
    Issue #3191038 by eelkeblok, pyrello: Hide author vertical tab when...
eelkeblok’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.