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.
The patch in #2041287: Convert $node->nid to $node->id() and $node->isNew() was a bit to zealous and converted a $node->nid too many.
In \Drupal\comment\Plugin\views\field\NodeNewComments::preRender() the $node variable is a simple object from a databse result with only an nid and num_comments property.
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff.txt | 707 bytes | borisson_ |
#13 | call_to_undefined-2505879-13.patch | 6.16 KB | borisson_ |
Comments
Comment #1
JvE CreditAttribution: JvE at One Shoe commentedComment #2
olli CreditAttribution: olli commentedNice find. I think we need a test here.
Comment #4
RavindraSingh CreditAttribution: RavindraSingh as a volunteer and at Srijan | A Material+ Company commentedWithout tests.
Comment #5
RavindraSingh CreditAttribution: RavindraSingh as a volunteer and at Srijan | A Material+ Company commentedComment #6
RavindraSingh CreditAttribution: RavindraSingh as a volunteer and at Srijan | A Material+ Company commentedHere, I am adding a patch which includes tests in DefaultViewRecentCommentsTest.php file. I am not sure how to write the tests here, Adding the tests in existing file.
Here I am not sure if we can add more tests into single file.
Comment #7
RavindraSingh CreditAttribution: RavindraSingh as a volunteer and at Srijan | A Material+ Company commentedMoving back to needs work.
Needs guidelines for writing tests.
Comment #8
andypostshould be
$node->nid
as patch #1 doesComment #9
geertvd CreditAttribution: geertvd at XIO commentedAdded some tests for this
Comment #13
borisson_Fixed a small nitpick in the patch. (Short array syntax).
This has tests so removing the tag.
Comment #14
borisson_Since I didn't really change anything with the patch I added and test still pass, I feel I can RTBC this issue.
Comment #15
andypost+1 rtbc
Comment #16
alexpott@borisson_ the short array syntax is a recommendation rather than a standard.
This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes.Committed f85c0c1 and pushed to 8.0.x. Thanks!