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.
Problem/Motivation
Part of #2649768: [meta] No definition of "Experimental" & not nearly enough warning. Site builders using experimental modules might struggle with troubleshooting or understanding the functionality of experimental modules, or with understanding why their help information is not complete.
Proposed resolution
Display a warning on the module help page when the module is experimental.
Remaining tasks
Patch needs review. Also see note in #3 about a potential followup.
User interface changes
Experimental modules display a warning message on their help page.
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#20 | interdiff-20.txt | 507 bytes | xjm |
#20 | help-2657178-20.patch | 5.68 KB | xjm |
#18 | interdiff.txt | 1.13 KB | xjm |
#18 | help-2657178-18.patch | 5.7 KB | xjm |
#17 | interdiff-help-17.txt | 694 bytes | xjm |
Comments
Comment #2
xjmWorking on tests.
Comment #3
xjmAttached adds a test and also fixes a sloppy copy. The test module itself is added to system since it will be useful for other tests (e.g. #2560597: Mark Migrate* modules as Experimental itself did not add any test coverage).
I have some concern that we're making the "Core (Experimental)" package name very magical (in the original issue and again here). It might be better to add a boolean flag to the module info? That would not really have been a good choice in #2560597: Mark Migrate* modules as Experimental right before RC, but we could do it in a minor. Out of scope for this issue, but could be a followup.
Comment #4
xjmHm, assuming the test-only patch passed because of #2657482: Test bot doesn't apply the patch; we'll see what the next run reports.
Comment #6
alexpottSeems a shame to make install Drupal just to make one assertion. Couldn't this be part of
Drupal\help\Tests\HelpTest::testHelp()
?Super minor nit... missing a docblock...
Would be good enough.
Nice to see an test module for this... one day the three experimental modules in core might no longer be experimental :)
And also nice the help has it's own and doesn't use system's test experimental module since we're testing help module functionality.
Comment #9
xjmNo, I looked into that. HelpTest installs a load of crap, including standard and like all the things. Plus then we would need to add the experimental module to be installed in that test as well. Separate environment needed for the test, so separate installation makes sense.
We have, or had, a standard that
setUp()
methods do not have docblocks. Has this changed? If it has, core is not compliant with the changed standard.Comment #10
xjmOh FFS. :P
Comment #11
xjmRe: #6 point 2, I forgot that #338403: Use {@inheritdoc} on all class methods (including tests) got reopened and the policy changed. :)
Comment #12
alexpottI didn't mean add another test method I meant just add it to the existing testHelp() method. In fact we could even make the help_test module an experimental module. Because that module just exists to test help... Hmmm... but actually that gets to another point - we should also test that message does not appear because it's the logic we want to test - not the message contents. So we do need 2 test modules.
Comment #13
xjmAttached adds the
{@inheritdoc}
per #11, properly marks the experimental module as hidden, and makes it conform to the expected help documentation standards. I also made the version number match #2656994: Experimental modules should have their own version numbers. (Naturally, since we are testing the "Core (Experimental)" package, it can't be in the "Testing" package.)Comment #14
xjmPer #12, adding another assertion for a non-experimental module. We can't use
help_test.module
because that module is not actually for testing help -- it's for testing empty help. :P It should maybe beempty_help_test.module
. But that's not in scope here, so I just added a separate test module.I looked again at
HelpTest
and it really did not seem like a good fit in this case. There are many times when adding an assertion to an existing test is the best thing to do, but I don't think this is one of them.Also adding a missing typehint to the first test module.
Comment #16
xjmThis set of assertions isn't strong enough to avoid a false positive (or is it false negative?); it could be a 403/404/etc. I'll add assertions.
Comment #17
xjmFixed in attached.
Comment #18
xjmComment #19
alexpottI've manually tested the patch by enabling migrate and visiting the migrate help page and the message shows. This looks ready.
Comment #20
xjmLeftover line from a copy/paste. Removed in attached. Leaving at RTBC since this is trivial/docs.
Comment #22
catchCommitted/pushed to 8.1.x, thanks!