Skip to content

Commit 4acc455

Browse files
authored
Set log message during entity:save (#6103)
1 parent b8e9158 commit 4acc455

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Commands/core/EntityCommands.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Drupal\Core\Entity\EntityStorageException;
1313
use Drupal\Core\Entity\EntityTypeManagerInterface;
1414
use Drupal\Core\Entity\Query\QueryInterface;
15+
use Drupal\Core\Entity\RevisionLogInterface;
1516
use Drush\Attributes as CLI;
1617
use Drush\Commands\AutowireTrait;
1718
use Drush\Commands\DrushCommands;
@@ -164,6 +165,9 @@ public function doSave(string $entity_type, array $ids, ?string $action): void
164165
$entity->setUnpublished();
165166
}
166167
}
168+
if (is_a($entity, RevisionLogInterface::class)) {
169+
$entity->setRevisionLogMessage(dt('Re-saved by Drush entity:save. Action is !action.', ['!action' => $action ?? 'none']));
170+
}
167171
$entity->save();
168172
}
169173
}

0 commit comments

Comments
 (0)