This issue has novice tasks. If you are an experienced core developer and have multiple commit mentions, please review novices' work on these tasks rather than doing them yourself. Feedback from experienced contributors is valued.
Problem/Motivation
- Clean install of Drupal 8, standard profile.
- Enable the forum module.
- Add the "New forum topics" or "Active forum topics" block to any region.
See this PHP notice:
Notice: Undefined variable: elements in Drupal\forum\Plugin\Block\ForumBlockBase->build() (line 32 of core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php).
Proposed resolution
Fix the PHP notice :)
Remaining tasks
- Write patch (novice)
- Review patch to check it fixes the issue, the change is properly documented and for coding standards. Provide test evidence (novice)
- Keep issue summary up to date (novice)
User interface changes
n/a
API changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#13 | forum-block-2228941.pass_.patch | 1.46 KB | larowlan |
#13 | forum-block-2228941.fail_.patch | 888 bytes | larowlan |
#5 | 2228941-5.patch | 608 bytes | andrei.dincu |
Comments
Comment #1
kokobutter CreditAttribution: kokobutter commentedComment #2
kokobutter CreditAttribution: kokobutter commentedcould not recreate the problem. i did everything you mention and there were not error.
Comment #3
kokobutter CreditAttribution: kokobutter commentedComment #4
star-szrI tested again on a different machine and I'm still seeing this. @kokobutter it's possible your PHP error reporting is set to not show notices.
Comment #5
andrei.dincu CreditAttribution: andrei.dincu commentedI confirm this issue.
I also add a patch for it.
Only initialise $elements variable as array().
Waiting for you feedback.
Comment #6
andrei.dincu CreditAttribution: andrei.dincu commentedComment #7
larowlanComment #8
rahulbile CreditAttribution: rahulbile commentedTested issue and patch, and seems to be working fine.
Comment #9
rahulbile CreditAttribution: rahulbile commentedComment #10
larowlanStill needs tests?
Comment #11
rahulbile CreditAttribution: rahulbile commentedComment #12
larowlanNeeds automatic tests.
should be part of ForumBlockTest
Comment #13
larowlanJust needed to re-order existing test, RTBC if red/green
Comment #15
larowlanAlthough I added patch above, it was just reordering existing tests, so think I'm still allowed to rtbc.
Comment #16
star-szr+1
Comment #17
webchickLooks good!
Committed and pushed to 8.x. Thanks!