Some work has been done already on the D9 compatibility of this module. But there was one part left over. The services.yml file is still injecting @entity.manager, which is deprecated for @entity_type.manager. Funnily enough the actual service in src/ has the correct interface there.

Attaching a patch to resolve this.

Issue fork title-3172331

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanielVeza created an issue. See original summary.

DanielVeza’s picture

Status: Active » Needs review
FileSize
307 bytes
Deg’s picture

Worked for me! 👍

Greg Boggs’s picture

When I save a content type edit screen, I get this error:

Error: Call to undefined method Drupal\Core\Entity\EntityTypeManager::getViewModes() in Drupal\title\BundleConfigManager->getViewModeIds() (line 148 of modules/contrib/title/src/BundleConfigManager.php).

I'll see if I can fix it tomorrow.

Greg Boggs’s picture

Status: Needs review » Needs work
DanielVeza’s picture

Ah that function moved to the Entity Repository service not Entity Type Manager. We just need to put the right service in

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

Mikell’s picture

added service entity_display.repository

Greg Boggs’s picture

Thanks Mikell! I'll give it a test shortly.

~G

Greg Boggs’s picture

The merge request is now super close. Everything works except that the label on the title field does not display even when it's set.

Greg Boggs’s picture

While we are stuck on this D9 version, maybe the answer is to end the Title module and direct everyone to:

https://www.drupal.org/project/manage_display

HongPong’s picture

I appear to be catching "Trait 'Drupal\Core\Routing\LinkGeneratorTrait' not found"

"in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Link instead."

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Link.php/...

at /title/src/Plugin/Field/FieldFormatter/LinkedAndWrapped.php:22

The file has
use Drupal\Core\Routing\LinkGeneratorTrait;
and
use LinkGeneratorTrait;
on line 24.

Related line in viewElements is :
$text = $this->l($text, $parent->toUrl());
I succeeded in fixing it, I think with:
adding at top:

use Drupal\Core\Link;

and this:

$text = new Link($text, $parent->toUrl());

Apologies if this is noted somewhere else - it is quite late over here but, I think I am in the clear now! Sorry I need to take off - otherwise i would reroll a patch with these lines as they seem to be critical showstoppers.

Greg Boggs’s picture

This module replaces all the features of title and more, and has excellent D9 code already:

https://www.drupal.org/project/manage_display