Problem/Motivation

This was added to support RDF module which is now in contrib, we should deprecate then remove it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3458612

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

catch created an issue. See original summary.

catch’s picture

Title: Remove probably 'metadata' variable from node.html.twig » Remove legacy 'metadata' variable from node.html.twig

catch’s picture

Status: Active » Needs review
longwave’s picture

IIRC there are other weird bits of node.module that exist only to support RDF, we should try to remove those as well eventually.

longwave’s picture

Fixed the CR link, but has this already been removed? Where is metadata set in $variables anyway? Lots of false positives in grep but I couldn't spot where it is actually set.

catch’s picture

Where is metadata set in $variables anyway? Lots of false positives in grep but I couldn't spot where it is actually set.

I had the same problem. It's not set anywhere in core, only in RDF module. So we moved RDF out, and just left the support in the templates. I didn't know that twig allows printing completely null variables but apparently it does.

spokje’s picture

Seeing that this was for rdf, would this be the place it was set: https://git.drupalcode.org/project/rdf/-/blob/2.x/rdf.module?ref_type=he...

If it is, it was removed from core with the move of rdf to contrib.

catch’s picture

Another reason this particular one is crufty is that it only exists because the submitted variable itself is hard-coded in the template. If/when we do #2353867: [META] Expose Title and other base fields in Manage Display the submitted stuff would be in an extra field, and that would give RDF module the mechanism to add metadata directly alongside it anyway.

longwave’s picture

Status: Needs review » Needs work

Let's add a comment above the deprecation so when we come to this in 12.x we don't have to do the same archaeology to understand it isn't actually used in core.

catch’s picture

Status: Needs work » Needs review

Added a comment, good plan, it's so confusing.

spokje’s picture

Status: Needs review » Reviewed & tested by the community

De-confusing comment confirmed, RTBC for me.

catch’s picture

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

We also need to remove this from the six or so copies of node.html.twig around core, probably except for stable9 where it could stay.

longwave’s picture

I think readmore is also redundant, can't find where that is set in core either, although removing more stuff here is a bit of scope creep, perhaps we should punt this to a separate issue.

longwave’s picture

It looks like readmore was removed back in #372743: Body and teaser as fields !!!

longwave’s picture

Oh, this is mixed up with #3458782: Remove documentation for readmore, logged_in and is_admin from node.html.twig, the last commit here needs reverting.

catch’s picture

Removed the stray commit.

longwave’s picture

I realised this wasn't documented in the deprecation policy so opened #3459205: Document how to deprecate Twig variables to fix that.

The change record doesn't say this should be done in preprocess, rather hook_theme, but I guess that doesn't ultimately matter, better to add it close to where it is set? But then the change record should probably be updated to say that too.

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

ankitv18’s picture

Status: Needs work » Needs review

I've rebased the branch and removed metadata from profiles and themes.
Pipelines are passing ~~ hence moving into review.
cc: @longwave @catch

catch’s picture

Issue tags: -Novice

Opened an issue against RDF module #3462020: $node['metadata'] variable deprecation.

MR looks good to me, removing the novice tag.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

I did a minor rearranging of the code to keep the teaser setup and its deprecation together, otherwise this looks fine to me so RTBC.

catch’s picture

Minor rearranging looks good!

  • nod_ committed c1e7cc2d on 11.x
    Issue #3458612 by catch, longwave, ankitv18, Spokje: Remove legacy '...

nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed c1e7cc2 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

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