Skip to content

Commit

Permalink
Set log message during entity:save (#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Sep 6, 2024
1 parent b8e9158 commit 4acc455
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands/core/EntityCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\Query\QueryInterface;
use Drupal\Core\Entity\RevisionLogInterface;
use Drush\Attributes as CLI;
use Drush\Commands\AutowireTrait;
use Drush\Commands\DrushCommands;
Expand Down Expand Up @@ -164,6 +165,9 @@ public function doSave(string $entity_type, array $ids, ?string $action): void
$entity->setUnpublished();
}
}
if (is_a($entity, RevisionLogInterface::class)) {
$entity->setRevisionLogMessage(dt('Re-saved by Drush entity:save. Action is !action.', ['!action' => $action ?? 'none']));
}
$entity->save();
}
}
Expand Down

0 comments on commit 4acc455

Please sign in to comment.