Prevent taxonomy_forums field be removed in admin interface

Created on 1 December 2013, almost 11 years ago
Updated 24 April 2024, 7 months ago

The taxonomy_forums field can be removed in /admin/structure/types/manage/forum/fields page.

To reproduce this bug :
1) 1. install drupal 8.0.x locally
2) go to /admin/structure/content types/manage/forum/fields
3) click on manage field in front of forum field and delete it.

After the field be removed, will cause a lot of issues in forum.module, here is an example issue:

Fatal error: Call to a member function getBundles() on a non-object in /home/hej/src/php/drupal8/core/modules/forum/forum.module on line 151

Call Stack:
0.0000 644528 1. {main}() /home/hej/src/php/drupal8/index.php:0
0.0013 932624 2. drupal_handle_request() /home/hej/src/php/drupal8/index.php:15
0.0281 3811328 3. Drupal\Core\DrupalKernel->handle() /home/hej/src/php/drupal8/core/includes/bootstrap.inc:1880
0.0285 3913536 4. Drupal\Core\HttpKernel->handle() /home/hej/src/php/drupal8/core/lib/Drupal/Core/DrupalKernel.php:282
0.0285 3915064 5. Symfony\Component\HttpKernel\HttpKernel->handle() /home/hej/src/php/drupal8/core/lib/Drupal/Core/HttpKernel.php:52
0.0285 3915064 6. Symfony\Component\HttpKernel\HttpKernel->handleRaw() /home/hej/src/php/drupal8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:61
0.0537 5233392 7. call_user_func_array() /home/hej/src/php/drupal8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:117
0.0537 5234008 8. Drupal\Core\Controller\HtmlPageController->content() /home/hej/src/php/drupal8/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:0
0.2079 8967536 9. drupal_render_page() /home/hej/src/php/drupal8/core/lib/Drupal/Core/Controller/HtmlPageController.php:100
0.2422 10864728 10. drupal_render() /home/hej/src/php/drupal8/core/includes/common.inc:3678
0.2423 10868472 11. theme() /home/hej/src/php/drupal8/core/includes/common.inc:3886
0.2439 11082464 12. template_preprocess_page() /home/hej/src/php/drupal8/core/includes/theme.inc:718
0.2533 11275424 13. menu_get_local_actions() /home/hej/src/php/drupal8/core/includes/theme.inc:2359
0.2533 11275424 14. menu_local_tasks() /home/hej/src/php/drupal8/core/includes/menu.inc:2210
0.2569 11360800 15. forum_menu_local_tasks() /home/hej/src/php/drupal8/core/includes/menu.inc:2005

So we should lock the taxonomy_forums field to prevent it be removed from admin interface.

📌 Task
Status

Needs work

Version

1.0

Component

forum.module

Created by

🇨🇳China jian he

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024