$form['scheduler']['publish']['advanced']['scheduler_publish_past_date_created']['#description']=t('The entity type does not support the change of creation time.');
'#title'=>t('How far into the future should the items be scheduled?'),
'#description'=>t('Scheduled dates will be set randomly within the selected time span.'),
'#options'=>$options,
'#default_value'=>86400,
];
}
// Add form items to specify what proportion of generated entities should have
// a publish-on and/or unpublish-on date assigned. See hook_entity_presave()
@@ -531,7 +570,7 @@ function _scheduler_devel_generate_form_alter(array &$form, FormStateInterface $
$form['scheduler_publishing']=[
'#type'=>'number',
'#title'=>t('Publishing date for Scheduler'),
'#description'=>t('Enter a percentage for randomly selecting Scheduler-enabled entities to be given a publish-on date. Enter 0 for none, 100 for all. The date and time will be random within the range starting at entity creation date, up to a time in the future matching the same span as selected above for creation date.'),
'#description'=>t('Enter a percentage for randomly selecting Scheduler-enabled entities to be given a publish-on date. Enter 0 for none, 100 for all. The date and time will be random within the range starting at entity creation date, up to a time in the future matching the same span as selected above.'),
'#default_value'=>50,
'#required'=>TRUE,
'#min'=>0,
@@ -540,7 +579,7 @@ function _scheduler_devel_generate_form_alter(array &$form, FormStateInterface $
$form['scheduler_unpublishing']=[
'#type'=>'number',
'#title'=>t('Unpublishing date for Scheduler'),
'#description'=>t('Enter a percentage for randomly selecting Scheduler-enabled entities to be given an unpublish-on date. Enter 0 for none, 100 for all. The date and time will be random within the range starting at the later of entity creation date and publish-on date, up to a time in the future matching the same span as selected above for creation date.'),
'#description'=>t('Enter a percentage for randomly selecting Scheduler-enabled entities to be given an unpublish-on date. Enter 0 for none, 100 for all. The date and time will be random within the range starting at the later of entity creation date and publish-on date, up to a time in the future matching the same span as selected above.'),
'#default_value'=>50,
'#required'=>TRUE,
'#min'=>0,
@@ -733,6 +772,7 @@ function scheduler_entity_presave(EntityInterface $entity) {
if(isset($entity->devel_generate)){
static$publishing_percent;
static$unpublishing_percent;
static$entity_created;
static$time_range;
if(!isset($publishing_percent)){
@@ -740,20 +780,21 @@ function scheduler_entity_presave(EntityInterface $entity) {
thrownew\Exception(sprintf('Invalid or empty entity type definition for %s module. Do a full cache clear via admin/config/development/performance or drush cr.',$plugin->dependency()));