Error after migration: The Privatemsg Message entity type needs to be installed.

Created on 16 November 2023, 12 months ago
Updated 20 November 2023, 12 months ago

After a D7 -> D9/10 migration, whenever I go to the Drupal status page, this error is shown:

Privatemsg Message

    The Privatemsg Message entity type needs to be installed.

PrivateMsg Thread

    The PrivateMsg Thread entity type needs to be installed.

My question is: How do I resolve this, so that the error goes away?

Also, there IS privatemsg data in the system, and also on the uninstall page it shows the following:

Private Messages 	Allow private messages between users.
The following reasons prevent Private Messages from being uninstalled:

    There is content for the entity type: Privatemsg Message. Remove privatemsg messages.
    There is content for the entity type: PrivateMsg Thread. Remove privatemsg threads.

System Info:
Drupal 10.1.6
PHP 8.1.3
Privatemsg 2.0.0-alpha5

🐛 Bug report
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hoporr
  • Status changed to Closed: won't fix 12 months ago
  • I was able to resolve this with an update hook like this:

    $type_manager = \Drupal::entityTypeManager();
        $type_manager->clearCachedDefinitions();
        $entity_type = $type_manager->getDefinition('privatemsg_message');
        \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type);
        
        $type_manager = \Drupal::entityTypeManager();
        $type_manager->clearCachedDefinitions();
        $entity_type = $type_manager->getDefinition('privatemsg_thread');
        \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type);

    It would be intersting to know why this error happened (during migration), but it is gone now so from my end please close this again.

  • ivnish Kazakhstan

    hi hoporr!

    There is no migration from D7 to D9+ now. How did you do it?

  • Yes, that's a good question.

    I checked my migration logs, and there is no private mssage migration.

    However, I was running the V1 branch of privatemsg, and somehow all the data was there. Potentially, I had just copied the DB tables over back then, and it just worked with V1 ?

    When I upgraded for D10, this switched over to the V2 branch, and it did not work anymore. I noticed that the DB structure was different as well.

    So I reverted back to V1, and I get the message.

Production build 0.71.5 2024