Skip to content

Entity save command does not properly check for revision support. #6158

@Chi-teck

Description

@Chi-teck

To Reproduce

$ drush entity:save user

 ┌ Saving entities ─────────────────────────────────────────────┐
 │                                                              │
 └───────────────────────────────────────────────────────── 0/1 ┘


In ContentEntityBase.php line 305:
                                                
  Entity type user does not support revisions.  
                                                

I think it checks for revision support in wrong way. Implementing RevisionableInterface does not mean that entity actually supports revisions. Yes, that's weird.

I think the command should check it like follows.

$is_revisionable = $this->entityTypeManager->getDefinition($entity_type)->isRevisionable();

Ref: https://www.drupal.org/project/drupal/issues/2671352

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions