Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2887142-62: NodeType source plugin should include comment information
The method \Drupal\node\Plugin\migrate\source\d7\NodeType::fields()
contains dead code for comment data
public function fields() {
return [
'type' => $this->t('Machine name of the node type.'),
...
];
if ($this->moduleExists('comment')) {
$fields += $this->getCommentFields();
}
return $fields;
}
It needs to extend tests because no broken tests reports
Comment | File | Size | Author |
---|---|---|---|
#8 | 3007436-8-complete.patch | 1.82 KB | jofitz |
#8 | 3007436-8-test_only.patch | 1.22 KB | jofitz |
#2 | 3007436-2.patch | 622 bytes | andypost |
Comments
Comment #2
andypostI bet it needs backport to 8.6
Comment #3
andypostproper title
Comment #4
andypostAffects #2937844-7: Fix 'Squiz.PHP.NonExecutableCode' coding standard
Comment #6
andypostbot flux, probably
\Drupal\Tests\comment\Kernel\Migrate\d7\MigrateCommentTypeTest
could be extended to cover this methodComment #7
heddnNeeds tests, so back to NW.
Comment #8
jofitz CreditAttribution: jofitz at jofitz commentedAdded test.
Comment #10
mikelutzComment #12
mikelutzDiscussed in maintainers meeting with @heddn and @quietone. While we would not generally test the return value of the fields() method on a source plugin, because it's dynamic in this case, it's appropriate to test that the comment fields appear when they are supposed to. The fix is obviously correct, and should be backported into 8.6 as a bugfix.
RTBC on the condition that it passes tests against 8.6, which it should.
Comment #13
mikelutzComment #14
catchCommitted and pushed da44172f5c to 8.7.x and 7836638b08 to 8.6.x. Thanks!