Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fengtan’s picture

I believe that generated nodes' post date is already randomly distributed between "now" and the selected period you pick when you create content (see attached screenshot).

I had a quick test and noticed that post dates were indeed randomly created (edit generated nodes and check the "Authoring information" fields)

Did you mean something else ?

barraponto’s picture

Title: provide option to random generate node's post date » Provide drush option to randomize post date within a time range
Version: 7.x-1.2 » 7.x-1.x-dev

Indeed, dates are randomized in the form (the web user interface) but there's no option in the Drush command (the command line interface). Let's fix that! With this patch you can use date strings (it will use strtotime behind the curtains):

drush generate-content 420 0 --since='last year'

barraponto’s picture

Status: Active » Needs review
FileSize
1.61 KB
moshe weitzman’s picture

Status: Needs review » Needs work

Please add one or two examples on the command definition

barraponto’s picture

Status: Needs work » Needs review
FileSize
1.62 KB

Patch submitted by the Drush iq-submit command.

rj’s picture

This worked for me, would love to see it committed. Thanks.

moshe weitzman’s picture

Issue summary: View changes
Status: Needs review » Needs work

Still needs Examples in Drush help and needs D8 port.

humansky’s picture

Slightly different approach to the same problem, with added test conditions to verify the date is within valid range. Let me know what you guys think. If you like it, I will create a D8 version.

MustangGB’s picture

I think #5 is the superior approach due to the increased flexibility.

jonathan1055’s picture

This is still missing. It would be good to have the drush option to match the UI option. Latest dev version is now 4.x The issue has been migrated to DrupalSpoons
https://gitlab.com/drupalspoons/devel/-/issues/237