Follow up for #1871772-108: Convert custom blocks to content entities

Problem/Motivation

+++ b/core/modules/block/custom_block/custom_block.admin.inc
@@ -0,0 +1,98 @@
+function custom_block_type_edit(CustomBlockType $block_type) {
+ return entity_get_form($block_type);
Normally we add drupal_set_title('Edit %label block type', ...) here, but we can improve this later.

Proposed resolution

Update page callback

Remaining tasks

Update page callback

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Active » Postponed
larowlan’s picture

Changing tags

sun’s picture

Status: Postponed » Active
floydm’s picture

Status: Active » Needs review
FileSize
578 bytes

Patch attached.

sun’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Entity system, -D8 upgrade path, -Blocks-Layouts
catch’s picture

Status: Reviewed & tested by the community » Needs work

This should use 'title callback' rather than drupal_set_title().

sun’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Novice

Erm, no. Page title != menu link title.

The menu link title uses entity_page_label() as title callback already, so the menu link title is $entity->label().

The title of the page, however, is always supposed to be a user-friendly phrase "Edit %label thingie."

Berdir’s picture

Hm.

1. We actually don't seem to add that "normally". See the content type edit form, which also just as the content type and this is basically a 1-1 counterpiece of that.

2. This doesn't work for the manage/display fields tabs, where it falls back to just the block type label.

So, this patch actually introduces two inconsistencies, it's different for some local tasks and it's different to content types.

Edit: As discussed in IRC, other cases do work like this, e.g. the node and custom block local tasks but they don't have manage fields and similar tasks that wouldn't be doing this.

xjm’s picture

webchick’s picture

Title: Set page title when editing custom block type » Set page title when editing/managing custom block type or content type
Status: Reviewed & tested by the community » Needs work

We are a little inconsistent, but "Edit $foo" makes more sense to me as a title on an edit form than just "$foo". We already do this on individual nodes and custom blocks, for example, as well as image styles. So it makes sense to do so for their "parents": block types and custom content types. Expanding scope a little, because that's a good point that we should be consistent.

I think catch's concern boils down to #1830588: [META] remove drupal_set_title() and drupal_get_title(), but since that's all talk atm, doesn't seem to make sense to hold this simple patch up on it. Whatever method we work out there will just need to be applied here as well.

While I understand that page/menu title are different things, one thing I'm not clear on though is what's the value in keeping the page title + menu title different from each other in this instance? In IRC Berdir said that that would mean that "Manage fields", etc. would also have the page title of "Edit $foo" but to me that just makes sense; they're all "Edit" operations on the primary thing.

sun’s picture

The important difference is that when modules are dynamically creating menu links for these items, then those menu links should only contain the entity label, not "Edit [label]".

Are there examples of modules that are doing that? Administration menu.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Methinks this is outdated. The page title is set when editing content types.

If this is incorrect reopen the issue, by setting the status to 'Active', and add a comment explaining what still needs to be done.