Revealed via #1361232: Make the taxonomy entities classed objects

http://api.drupal.org/api/drupal/core--modules--forum--forum.module/func...

cannot work, because an TaxonomyTerm entity is passed into the hook, not a $tid.

Tasks:

- Change the argument to $term.

- For D8, add TaxonomyTerm type-hinting for $term.

- Add a test to Forum module, as this seems to be completely untested.

- Backport to D7.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Status: Active » Needs review
FileSize
1.77 KB

I think this should do it...

xjm’s picture

Looks like the patch includes a test.

fago’s picture

#1: 1401496.patch queued for re-testing.

fago’s picture

Status: Needs review » Reviewed & tested by the community

I gave the patch a test - it works, code looks good and comes with a test. -> RTBC

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Looks good. Committed/pushed to 8.x, moving to 7.x for backport.

sun’s picture

+++ b/core/modules/forum/forum.module
@@ -468,10 +468,10 @@ function forum_permission() {
+function forum_taxonomy_term_delete(stdClass $term) {

The stdClass type-hinting was bogus here. No need to fix in D8, since #1361232: Make the taxonomy entities classed objects will touch it either way.

However, should be removed for the D7 backport.

bleen’s picture

sun ... just curious why I shouldn't have used type-hinting here?

Albert Volkman’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.72 KB

D7 backport without type-hinting.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

The backport looks correct. Thanks @Albert Volkman!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x. Thanks!

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