Problem/Motivation
The usages of forum need to be removed so the module can be deprecated.
Steps to reproduce
$ grep --exclude-dir={fixtures,forum,node_modules,vendor,themes} -ri forum core | grep -vi migrat | grep Test | awk -F: '{print $1}' | sort -u | nl
1 core/modules/comment/tests/src/Functional/CommentFieldsTest.php
2 core/modules/node/tests/src/Functional/NodeTypeTest.php
3 core/modules/system/tests/src/Functional/Update/Y2038TimestampUpdateTest.php
4 core/tests/Drupal/KernelTests/Config/Schema/MappingTest.php
There is also a usage in core/modules/system/tests/modules/url_alter_test/url_alter_test.install
Proposed resolution
- core/modules/comment/tests/src/Functional/CommentFieldsTest.php - remove deletion of comment_forum field
- core/tests/Drupal/KernelTests/Config/Schema/MappingTest.php - replace with a new test module
- core/modules/node/tests/src/Functional/NodeTypeTest.php - this is a comment, fixed in #3409388: Remove usage of forum module from comments and strings
- core/modules/system/tests/src/Functional/Update/Y2038TimestampUpdateTest.php - no change, An update test using forum that will be removed in 11.0
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3409385
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3409385-remove-usage-of
changes, plain diff MR !6101
Comments
Comment #2
quietone commentedComment #4
quietone commentedStill need to investigate core/modules/system/tests/modules/url_alter_test/url_alter_test.install
Comment #5
quietone commentedThis function,
was added in #320331-69: Turn custom_url_rewrite_inbound and custom_url_rewrite_outbound into hooks. This is executed in \Drupal\Tests\path_alias\Functional\UrlAlterFunctionalTest and forum is no longer installed in the test. If the hook is deleted the test still passes. So, is this really unneeded code or is the test not doing what it should be. I don't know enough about this area of core to say.
And, because of the use of forum this test was copied to the forum module, \Drupal\Tests\forum\Functional\UrlAlterFunctionalTest with a new test module, forum_url_alter_test. In that test module the hook is absent So, perhaps this really is dead code.
Comment #6
catchI did the following:
And the answer is - we took the forum bits of the test out in a previous patch, and this bit got missed.
If the forum tests pass without this hook_install() too, I think it's fine to remove as dead code. It was added a very, very long time ago.
Comment #7
smustgrave commentedTried following the best I could
I commented out url_alter_test_install. Both UrlAlterFunctionalTest (path_alias) and UrlAlterFunctionalTest (forum) still pass.
Comment #8
catchYep I think we can just remove it.
Comment #9
quietone commentedI removed the file as the hook was the only thing it contained.
Comment #10
smustgrave commentedKnow I posted in slack leaving tickets in review longer. But based on the importance of this to get Forum deprecated by D11 going to go ahead and mark.
Comment #11
xjmComment #12
xjmJust documenting my own results while I review.
Before
After
Per the IS:
Is there an issue for this? If not, we should file it parented to the D11 beta blocker meta or one of its children. (And add to related issues here.)
This is out of scope, but: Do we have other tests of 2038 upgrade paths? I guess the idea is that people must upgrade to 10.3/10.4 first regardless, which would already require their timestamps to be updated, and so it's not needed in D11. But it seems weird to have the test of this coupled only to Forum.
I diffed the Forum and new test fixure config:
Comment #13
xjmI reviewed all the uses of
url_alter_testin core and agree that install hook can be removed. The fiddling with Forum's weight was added in #320331-69: Turn custom_url_rewrite_inbound and custom_url_rewrite_outbound into hooks, as in, well before the release of D7, when everything to do with URLs, routing, and module weights/dependencies was wildly different. That comment reads:Some other quotes from that issue:
So overall I think this is ready, but NW for the followup I mentioned in #12.1.
Comment #14
quietone commented@xjm, thanks for the review.
#12.1. The followup issue for that is #3414563: Add new 10.3.x database dump fixtures, without modules deprecated for removal in 11.x. It is already a related issue but it can't be a child because the plan is to do the dumps once for all the deprecated modules.
I am setting back to RTBC because I think that followup was the only item.
Comment #15
catchFor #12.1 there is also #3401188: [policy] Remove update hooks added until 10.3 from Drupal 11 for removing updates prior to 10.3.0, so we're covered whether updates or forum module itself get removed first.
#12.2 there's explicit test coverage for field items and 2038+ timstamps being added in #2885413: Timestamp field items are affected by 2038 bug. We've only fixed the one-off schema entries around core so far, some work is still outstanding on the 2038 bug.
Comment #17
catchCommitted/pushed to 11.x, thanks!
Comment #20
xjmAmending attribution.
Comment #21
claudiu.cristeaAny idea why the
config_mapping_testmodule has been added in the "Core" package?