Bring back the admin label on the block

Created on 13 March 2023, over 1 year ago
Updated 23 April 2024, 5 months ago

Problem/Motivation

ViewsBlockBase overrides and hides the admin label, as it assumes only one instance of the block will be used. Since this module allows using multiple blocks, it actually makes sense to allow the admin label on the config form, so we can tell the difference on the block layout page.

Steps to reproduce

Add a few blocks to the layout page, see they all have the same admin label.

Proposed resolution

Reenable the field.

Remaining tasks

User interface changes

Admin label is added back onto the block config form.

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devkinetic

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

Comments & Activities

  • Issue created by @devkinetic
  • @devkinetic opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States devkinetic
  • πŸ‡ΊπŸ‡ΈUnited States devkinetic

    Moving back to needs work as on subsequent edits of the block, it tries to reset the admin label back to the views default.

  • Status changed to Needs work over 1 year ago
  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    You needed to get the label from configuration when set. Adjusted the MR.

  • Status changed to RTBC 10 months ago
  • πŸ‡§πŸ‡ͺBelgium borisson_ Mechelen, πŸ‡§πŸ‡ͺ

    This change makes sense, looks good to me.

  • Status changed to Needs work 8 months ago
  • πŸ‡ͺπŸ‡ΈSpain manuel.adan 🌌

    The label field is required, so after the patch, editing existing block instances forces to provide now a title. I think that it could be optional, since create new instances without a label is a admitted situation.

    In addition to that, there is another "Title" field when the "Override title" options is enabled, which might cause confusion. Renaming the instance label as "Administrative title" could be a work around for that.

  • Status changed to Needs review 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Aren't both of those scenarios valid? I see in other block instances the title is required and those that have override title the field that displays is title.

    But if it's a blocker can we just add $form['label']['#title'] = $this->t('Admin label'); to the bottom of the change?

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    But MR solves the issue I was seeing. I'm currently using 2 blocks to have the sort filters in the top right and all others in the left column.

Production build 0.71.5 2024