Issue #2934026 by Sam152, govind.maloo, vacho, Jo Fitzgerald, amateescu,...
Issue #2934026 by Sam152, govind.maloo, vacho, Jo Fitzgerald, amateescu, Berdir, mikelutz: Deprecate isLatestRevision, getLatestRevision, getLatestRevisionId in the ModerationInformation service
@trigger_error(__METHOD__.' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableStorageInterface::getLatestRevisionId() and RevisionableStorageInterface::loadRevision() instead. See https://www.drupal.org/node/3087295',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableStorageInterface::getLatestRevisionId() instead. See https://www.drupal.org/node/3087295',E_USER_DEPRECATED);
@trigger_error(__METHOD__.' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableInterface::isLatestRevision() instead. See https://www.drupal.org/node/3087295',E_USER_DEPRECATED);
return$entity->isLatestRevision();
}
/**
@@ -171,7 +166,7 @@ public function hasPendingRevision(ContentEntityInterface $entity) {
* @expectedDeprecation Drupal\content_moderation\ModerationInformation::getLatestRevisionId is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableStorageInterface::getLatestRevisionId() instead. See https://www.drupal.org/node/3087295
*/
publicfunctiontestGetLatestRevisionId(){
$entity_test_rev=EntityTestRev::create([
'name'=>'Default Revision',
'moderation_state'=>'published',
]);
$entity_test_rev->save();
$entity_test_rev->name='Pending revision';
$entity_test_rev->moderation_state='draft';
$entity_test_rev->save();
// Check that moderation information service returns the correct latest
// revision ID.
@@ -84,6 +100,48 @@ public function testDefaultAndLatestRevisionId() {
$this->assertSame(2,$latest_revision_id);
}
/**
* @covers ::getLatestRevision
* @group legacy
* @expectedDeprecation Drupal\content_moderation\ModerationInformation::getLatestRevision is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableStorageInterface::getLatestRevisionId() and RevisionableStorageInterface::loadRevision() instead. See https://www.drupal.org/node/3087295
* @expectedDeprecation Drupal\content_moderation\ModerationInformation::isLatestRevision is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableInterface::isLatestRevision() instead. See https://www.drupal.org/node/3087295
* @expectedDeprecation Drupal\content_moderation\ModerationInformation::getLatestRevisionId is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use RevisionableStorageInterface::getLatestRevisionId() instead. See https://www.drupal.org/node/3087295