Issue #3345272 by Rassoni, elber, Ranjit1032002, Rishabh Vishwakarma, Liam Morland, smustgrave: Fix deprecation documentation for node_revision_load()

merge-requests/3903/head
Dave Long 2023-04-30 19:08:39 +01:00
parent 3b7dc0f28b
commit 0dc53e4f69
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
2 changed files with 8 additions and 8 deletions

View File

@ -354,7 +354,7 @@ function node_entity_extra_field_info() {
* @see https://www.drupal.org/node/3323340
*/
function node_type_update_nodes($old_id, $new_id) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::updateType instead. See https://www.drupal.org/node/3323340', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::updateType instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);
return \Drupal::entityTypeManager()->getStorage('node')->updateType($old_id, $new_id);
}
@ -368,12 +368,12 @@ function node_type_update_nodes($old_id, $new_id) {
* A fully-populated node entity, or NULL if the node is not found.
*
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
* \Drupal\Core\Entity\EntityStorageInterface::loadRevision instead.
* \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.
*
* @see https://www.drupal.org/node/3323340
*/
function node_revision_load($vid = NULL) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::loadRevision instead. See https://www.drupal.org/node/3323340', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);
return \Drupal::entityTypeManager()->getStorage('node')->loadRevision($vid);
}
@ -384,12 +384,12 @@ function node_revision_load($vid = NULL) {
* The revision ID to delete.
*
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
* \Drupal\Core\Entity\EntityStorageInterface::deleteRevision instead.
* \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead.
*
* @see https://www.drupal.org/node/3323340
*/
function node_revision_delete($revision_id) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3323340', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);
\Drupal::entityTypeManager()->getStorage('node')->deleteRevision($revision_id);
}

View File

@ -28,7 +28,7 @@ class NodeDeprecationTest extends KernelTestBase {
*/
public function testNodeRevisionLoadDeprecation(): void {
$this->installEntitySchema('node');
$this->expectDeprecation('node_revision_load is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::loadRevision instead. See https://www.drupal.org/node/3323340');
$this->expectDeprecation('node_revision_load is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237');
node_revision_load(1);
}
@ -39,7 +39,7 @@ class NodeDeprecationTest extends KernelTestBase {
*/
public function testNodeRevisionDeleteDeprecation(): void {
$this->installEntitySchema('node');
$this->expectDeprecation('node_revision_delete is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3323340');
$this->expectDeprecation('node_revision_delete is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237');
node_revision_delete(1);
}
@ -50,7 +50,7 @@ class NodeDeprecationTest extends KernelTestBase {
*/
public function testNodeTypeUpdateNodesDeprecation(): void {
$this->installEntitySchema('node');
$this->expectDeprecation('node_type_update_nodes is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::updateType instead. See https://www.drupal.org/node/3323340');
$this->expectDeprecation('node_type_update_nodes is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::updateType instead. See https://www.drupal.org/node/3294237');
node_type_update_nodes(1, 2);
}