There's an old @todo in InlineFormInterface::getEntityTypeLabels():

Remove when #1850080 lands and IEF starts requiring Drupal 8.1.x

#1850080: Entity type labels lack plurality, cannot generate UI text based on label if plural is needed is the issue that added the entity singular, plural, and count label formatters. It was committed years ago. It looks like this function was added to work around the problem of not having those formatters back in the day.

Proposed Resolution

  1. Close #3149783: Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels() as being outdated. Grant credit here to people who did work in that issue. No, we fixed that issue directly and let the folks be credited there.
  2. Deprecate InlineFormInterface::getEntityTypeLabels().
  3. Make EntityInlineForm::getEntityTypeLabels() return the singular/plural entity type labels. (Done via #3149783: Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels())
  4. Delete NodeInlineForm::getEntityTypeLabels().
  5. Draft a change record and add its URL to the @deprecated message before committing.
  6. Commit and publish the change record.
  7. Create a follow-up issue to remove the function in 4.x and have InlineEntityFormBase::getEntityTypeLabels() return the singular/plural entity type labels directly.
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

dcam created an issue. See original summary.

dcam’s picture

Issue summary: View changes
dcam’s picture

Issue summary: View changes

Updated the proposed resolution because I don't think we can change InlineEntityFormBase::getEntityTypeLabels() to use the entity label formatters yet. If we did, then no InlineFormInterface::getEntityTypeLabels() functions would be getting executed at all, breaking backward compatibility.

dcam’s picture

Issue summary: View changes

Noted that a change record should be created.

dcam’s picture

Status: Active » Needs review

The MR covers items 2, 3, and 4 from the proposed resolution. It even has a deprecation test, per Drupal's deprecation policy. The majority of the changes resulted from the removal of NodeInlineForm::getEntityTypeLabels() because Core tried to get away from using the word "node" on the front end in favor of "content item." So all of the assertions that were looking for the word "node" in the UI had to be updated.

dcam’s picture

I should have searched for existing issues. Shame on me. See #3051925: deal with TODO for 1850080.

dww’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
Related issues: +#3149783: Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels()

This needs a rebase / reroll now that #3149783: Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels() is committed.

Thanks,
-Derek

dcam’s picture

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

This was my first experience using the GitLab conflict resolver tool. At least in this case it made the resolution quick and easy, but that's at least partly because this MR contained the exact same changes that caused the conflict.

I also took the time to resolve the PHPCS issues that were introduced by the patch. Although there are now two more issues, but that's due to me using placeholder text for the change record URL that needs to be added to the deprecated function. I haven't drafted a CR yet because there hasn't been any consensus about the change.

dww’s picture

Issue summary: View changes

Great, thanks! A few updates to the summary. +1 to the plan. Feel free to draft a CR for this so we can get the link right and see a fully green pipeline here.

Thanks again,
-Derek