Problem/Motivation

In #2887142: NodeType source plugin should include comment information We deprecated comment variable sources in favor of integrating them into NodeType. In order to preserve BC, so code was added to the Comment source, for migrations that might still be using the deprecated sources. This code was encapsulated in a method that was incorrectly marked as deprecated. Deprecated code should not be used anywhere in core. This code is a necessary BC shim intended to be used in Drupal 8 but unneeded in Drupal 9. Therefore this code should not be deprecated until it is no longer needed, i.e. in Drupal 9, and then removed in Drupal 10.

Proposed resolution

Undeprecate the method and file a follow-up issue to deprecate the code in D9, and comment the code with @todos referencing the followup.

Remaining tasks

Do it

User interface changes

none.

API changes

Previously deprecated method Comment::prepareComment() is now marked @internal

Data model changes

none

Release notes snippet

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikelutz created an issue. See original summary.

mikelutz’s picture

This method should actually be marked as internal.

mikelutz’s picture

Title: Properly deprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment » Undeprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment() and mark as internal.
Issue summary: View changes
Status: Active » Needs review
FileSize
1.38 KB

This patch should only change documentation, not functionality.

quietone’s picture

Status: Needs review » Needs work

Just a typo

+++ b/core/modules/comment/src/Plugin/migrate/source/d6/Comment.php
@@ -45,7 +49,12 @@ public function prepareRow(Row $row) {
+   * @todo Remove this method and its use in in drupal:9.0.0.

s/in in/in

dhirendra.mishra’s picture

Assigned: Unassigned » dhirendra.mishra

Let me do it

dhirendra.mishra’s picture

Pls review updated patch

mikelutz’s picture

Status: Needs review » Needs work

I think this needs to be handled a bit differently. patch coming soon.

mikelutz’s picture

Title: Undeprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment() and mark as internal. » Undeprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment()
Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.41 KB
1.46 KB

After further thought and discussions, this code is used in Drupal 8, and the @internal tag is not realistically respected, so we don't want to just remove an internal method. The actual correct solution here is to simply remove the @deprecated tag, as the method is in use and is therefore not yet deprecated.

When the Drupal 9 branch is opened, the calls to this method can be removed, and it can be deprecated at that time for removal in Drupal 10.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Removing a deprecation seems fine here.

larowlan’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/comment/src/Plugin/migrate/source/d6/Comment.php
@@ -34,18 +34,29 @@ public function query() {
+   * @throws \Exception

we need to document when the exception can occur, thanks!

mikelutz’s picture

heddn’s picture

Status: Needs review » Reviewed & tested by the community

And back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 239ce7f and pushed to 8.8.x. Thanks!

  • alexpott committed 239ce7f on 8.8.x
    Issue #3069055 by mikelutz, dhirendra.mishra, quietone, larowlan:...

Status: Fixed » Closed (fixed)

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