How to create Dummy Content with certain data restrictions (specific date ranges, users, values, ...) I know about the Devel Module's capability to generate random content (BUT almost no control over the data entered) and also about the D7 Devel script which is a possibility, but i'd like to have a module and not a script. The Dummy Content Module creates the content only upon installation, thats why it does not help me either cause i want to create it via a menu option like it is with the Devel Module.

I searched high and low but could not find a module that gives me that option, can anybody give me a hand here?

Problem

Creat Dummy Content with specific ranges for


date fields: e.g. between "now" and "now +10 day"
number fields: e.g. between 10 and 20 step 2
...
Quick solution that worked best for me in the end:

The solution i gave before was indeed the best one to have a general solution and use the mechanisms that were used in the devel module, but what worked best for me in the end was to just use the HOOK_node_presave to validate the nodes that were created by the devel module.

function MY_MODULE_node_presave($node) {
  // only do this for my_type, and only for nodes created by the devel module
  if ($node-&gt;type == 'MY_TYPE' &amp;&amp; isset($node-&gt;devel_generate)) {
    // apply the limitations, e.g. use values between 2 and 8 in our field
    $node-&gt;field_my_field["und"][0]["value"] = mt_rand(2, 8);
  }
}


In case a node of the type MY_TYPE is generated by the devel module (verified by checking the devel_generate property) we give the field field_my_field a value between 2 and 8. This is not possible with the devel module, but we can apply this custom restrictions here and modify the node before it is saved.

So the devel module will create the node as usual, but the function above will modify its values to our needs before it is being saved to the DB.

This has the desired effect although it is hard coded in our custom module, it does the trick.