Problem/Motivation

Drupal\link\LinkItemInterface has a getUrl method, but no getTitle.

Proposed resolution

Add Drupal\link\LinkItemInterface::getTitle

Issue fork drupal-3306201

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

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Issue summary: View changes

dieterholvoet’s picture

Status: Active » Needs review

Abhijith S made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs change record

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.

Reviewing the MR and the change looks good to me and can see this being very useful.

Only thing I see missing would be a change record indicating this new function.

Once that's added I can mark RTBC.

dieterholvoet’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

I added a draft change record. Reverting the commit and credit of @Abhijith S since the change is irrelevant (it actually introduces a CS issue) and the commit message is unrelated to the actual change. Seems like a low effort attempt to get issue credit.

smustgrave’s picture

thanks for the quick turnaround! Will wait for the tests to finish and mark it.

smustgrave’s picture

Status: Needs review » Needs work

CI failed.

dieterholvoet’s picture

Huh, seems like @Abhijith S was right. I'm sorry for the false accusation, my bad! That's weird though, I thought the Drupal core convention was to write null in uppercase.

dieterholvoet’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the quick responses @DieterHolvoet

Everything looks good to me now!

Good job!

xjm’s picture

Category: Feature request » Task
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs followup

Thanks for working on this. I agree this would be a good API addition. I left a comment on the MR to add a return typehint. (Since it's a new method, parameter and return typehints are required).

Adding new methods to an interface is a BC break. However, since the interface has a 1:1 relationship with the LinkItem class, method additions are allowed in minor releases.

Grepping contrib, there is one module that implements LinkItemInterface without extending LinkItem:
https://git.drupalcode.org/project/linked_entity_reference/-/blob/1.0.x/...

Their usecase for extending a different base class looks legit, so we could help them out and file an issue in that queue to add Drupal 10.1.x compatibility? I added a sentence to the CR to address their usecase.

Thanks!

xjm’s picture

Fixing attribution.

dieterholvoet’s picture

Status: Needs work » Needs review
Issue tags: -Needs followup

I added the return type and created the follow up issue: #3331248: Add a title getter to LinkedEntityReference.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed the 1 open thread has been resolved (but I can't resolve it)

Also see the follow up ticket was made for linked_entity_reference. See as they don't have a D10 release don't imagine that will be disruptive to anyone.

  • xjm committed 185ff290 on 10.1.x
    Issue #3306201 by DieterHolvoet, Abhijith S, smustgrave, xjm: Add a...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

OK this looks good now; nice addition. Committed to 10.1.x and published the change record. Thanks everyone!

Status: Fixed » Closed (fixed)

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