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.
When creating content for a test site using Devel Generate, it would be really helpful to have the scheduler publish_on and unpublish_on dates pre-filled, to allow quicker manual testing. Only content types enabled for the specific scheduler actions would have the appropriate date filled in. There should be some way for admins/developers to specify how many nodes get a date.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2890778-9.dates_for_devel_generate_with_tests.patch | 12.66 KB | jonathan1055 |
|
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHere are a couple of screen shots. The first shows the top of the devel form with the content-type table extended with a new column displaying the scheduler settings.
The second shows the bottom of the form, where the user can input the percentage of nodes to get the date added. 0 will do no dates, 100 will add a date for all nodes. Any percentage between will be compared with a random number betwwen 1-100 to decide if the date is added.
Patch is attached but there are no tests for this specific new code.
Comment #3
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have now written tests to cover this new functionality.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe devel_generate module was not available. Added the following to .info
I am guessing the project is 'devel' and the module is 'devel_generate'. Let's see ...
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedSo, according to the outcome of #2692407: Test_dependencies are downloaded before applying patches, rather than after the main dependencies and test dependencies are not re-evaluated after a patch is applied, so we cannot add dependencies via a patch. Needs to be committed to a branch. That's not good as I cannot test if the dependency syntax is correct before committing the change.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHere is the commit to add test_dependency
Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNow that I have committed the test_dependency changes I can see the following in the test log
so it looks like devel should be available now.
Comment #11
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNew tests pass :-)
Committed and completed. I have wanted this addition in my own test/dev sites for a while. Hope it helps others too.
Comment #13
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedUnassigning.