#2353867: [META] Expose Title and other base fields in Manage Display will introduce the "normal" mechanism for managing display of title and other base fields then deprecate the old specialist non-standard way. With the major release of D10 we should remove the deprecated code.

Changes required have @todo markers linking to this issue, and are summarised below.

Node template

  • Remove label, date, author_name - code can use elements[title] etc.
  • Remove page, display_submitted - if title/submitted should not be displayed then the corresponding elements will be missing or generate no markup.
  • Remove author_attributes, author_picture - instead the information will be part of the rendered formatter output of elements[uid].
  • Remove all process code related to the variables removed from the node template, including template_preprocess_node and rdf_preprocess_node.

Field templates

  • Remove all copies of field--node--title.html.twig, field--node--uid.html.twig, field--node--created.html.twig.
  • In node_theme remove field__node__XXX.

Once we are using field formatters for the base-field output we don't need these special cases.

Node type

Remove $display_submitted, displaySubmitted(), setDisplaySubmitted(), related form/schema. It is controlled through manage display UI settings instead.

Theme setting

Remove the theme setting features.node_user_picture. Instead this is controlled by a setting on the formatter for the uid field.

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Issue summary: View changes

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.

xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev

Major-only changes are 10.0.x at this point. However, we should do a proper deprecation in a minor release to support the continuous upgrade path from D9 to D10. Thanks!

adamps’s picture

Title: Remove outdated code relating to "Expose Title in Manage Display" » Deprecate outdated code relating to "Expose Title in Manage Display"
Issue summary: View changes
adamps’s picture

Title: Deprecate outdated code relating to "Expose Title in Manage Display" » Remove outdated code relating to "Expose Title in Manage Display"
andypost’s picture

Is there a way to deprecate templates and preprocess variables? I see no in https://www.drupal.org/about/core/policies/core-change-policies/drupal-c...

adamps’s picture

Version: 9.1.x-dev » 10.0.x-dev
Related issues: +#3176673: Deprecate non-standard display of title and other base fields

Changed this issue to D10. There is now a separate issue for deprecation: #3176673: Deprecate non-standard display of title and other base fields as requested by @laurii in #2993647: Correctly determine when to display fields as inline.

Is there a way to deprecate templates and preprocess variables?

In that issue @laurii stated that "We can use the Twig deprecated tag to deprecate templates..". For the variables we might have to do our best with comments.

I think there is a key point that allows us to do something unusual: we will deprecate all the ways in Core of using the templates/variables, hence we can reasonably remove them in the next major version.

Anyway I don't plan to worry about this one much at the moment as there are many other issues that need to be solved before it even becomes relevant.

johnpitcairn’s picture

Version: 10.0.x-dev » 11.x-dev
acbramley’s picture

Status: Active » Postponed (maintainer needs more info)

Can this be broken up into smaller chunks at all? It seems like this has quite a huge scope to cover for a single issue.

adamps’s picture

Title: Remove outdated code relating to "Expose Title in Manage Display" » [PP-many] Remove outdated code relating to "Expose Title in Manage Display"
Status: Postponed (maintainer needs more info) » Postponed

Can this be broken up into smaller chunks at all

This issue is a deprecation issue that depends on about 5 other open issues in #2353867: [META] Expose Title and other base fields in Manage Display so the question is somewhat theoretical at the moment.

I guess the patch will be quite large, but basically just be a load of deletions of deprecated code. I see no reason why it couldn't be split into multiple issues if desired.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.