Problem/Motivation

When creating a new 'reusable block', the block title defaults to the block types readable name (e.g. "basic block"), not the title provided in the create block form.

Additionally, when you re-use a reusable block, the 'title' field defaults to the 'admin title' (block description), not the title of the block that was used when you originally created the block.

Also, not sure if this was intended, but the title of the block is not universal, while the body is. This may be intended, but the info block that shows up (yellow box at the top of the form) implies that anything you change on this form update globally. (When in fact the title is not global, only the body is).

Steps to reproduce

  • Create a 'new' re-usable block (not an existing one)
  • Set the admin title to something
  • Set the 'title' in the form field to something, and enable 'display title'
  • The block is added to the page with the title 'Basic block' (or whatever the human readable name of the block type is)
  • Add the block to the page again by selecting it from the content blocks list. The 'default value' for the title field is set to the 'block description' (admin title)

Proposed resolution

The default title for newly created blocks should be what you provide in the 'Title' field on the create block form.
When adding a new instance of a previously created block, the default 'Title' field should default to the title of the original block (or no value at all).

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

jfurnas created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Patch fixes reusable block title defaults: new blocks now use the user-entered label (falling back to admin title) instead of the block type name, and existing reusable blocks default the title field to their admin title when placed.

jfurnas’s picture

Tested this patch. It works great for setting the title based on what the user provides when first creating the block, but it still captures the 'admin title' as the default title when reusing the block. Is it possible to re-use the user provided title of the original block (not the admin title) when a user re-uses the block?

  • nickolaj committed 0ec15e1f on 1.0.x
    Issue #3576039: Patch fixes reusable block title defaults: new blo...
    
m.shams’s picture

Tested the patch, and it works as expected in the admin module, allowing the block title to be set based on the user-provided value during initial block creation.

hamzadwaya’s picture

Thanks for testing! A reusable block only stores its admin title. The display title is saved separately for each placement, so there's no original title to reuse yet. It's possible to add, and I'll handle it in a follow-up issue. The fix for new blocks is in 1.0.4.

hamzadwaya’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.