Problem/Motivation

#2705433: Node should implement RevisionLogInterface deprecated Node::setRevisionAuthorId and Node::getRevisionAuthor and #2718583: Remove deprecated usages of Node::setRevisionAuthorId() and Node::getRevisionAuthor() removed its their use from core, but they don't trigger a deprecation error.

Proposed resolution

Add a deprecation error, and legacy test to finish the deprecation.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikelutz created an issue. See original summary.

mikelutz’s picture

mikelutz’s picture

Title: Properly deprecate Node::setRevisionAuthorId » Properly deprecate Node::setRevisionAuthorId and Node::getRevisionAuthor
Issue summary: View changes
mikelutz’s picture

Assigned: mikelutz » Unassigned
Status: Active » Needs review
FileSize
4.88 KB
Berdir’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/node/src/Entity/Node.php
@@ -257,6 +257,7 @@ public function setSticky($sticky) {
    */
   public function getRevisionAuthor() {
+    @trigger_error(__NAMESPACE__ . '\Node::getRevisionAuthor is deprecated in drupal:8.2.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser() instead. See https://www.drupal.org/node/3069750', E_USER_DEPRECATED);
     return $this->getRevisionUser();
   }

It feels a bit weird to say "use Interface::method", especially since it's just a different method on the same object, but that was the message before and is basically what we usually do.

Looks fine, has legacy tests (was a bit confused first as they look identical, but they each use one deprecated message and once the replacement).

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 347dbb0 and pushed to 8.8.x. Thanks!

  • alexpott committed 347dbb0 on 8.8.x
    Issue #3069033 by mikelutz, Berdir: Properly deprecate Node::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.