diff -u b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php --- b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -157,17 +157,27 @@ $fields['url'] = FieldDefinition::create('uri') ->setLabel(t('URL')) - ->setDescription(t('The URL to the feed.')) + ->setDescription(t(('The fully-qualified URL of the feed.')) ->setRequired(TRUE) ->setSetting('max_length', NULL) ->setDisplayOptions('form', array( 'type' => 'uri', - 'weight' => -4, + 'weight' => -3, )); - $fields['refresh'] = FieldDefinition::create('integer') - ->setLabel(t('Refresh')) - ->setDescription(t('How often to check for new feed items, in seconds.')); + $intervals = array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200); + $period = array_map('format_interval', array_combine($intervals, $intervals)); + $period[AGGREGATOR_CLEAR_NEVER] = t('Never'); + + $fields['refresh'] = FieldDefinition::create('list_integer') + ->setLabel(t('Update interval')) + ->setDescription(t('The length of time between feed updates. Requires a correctly configured cron maintenance task.', array('@cron' => url('admin/reports/status')))) + ->setRequired(TRUE) + ->setSetting('allowed_values', $period) + ->setDisplayOptions('form', array( + 'type' => 'options_select', + 'weight' => -2, + )); $fields['checked'] = FieldDefinition::create('timestamp') ->setLabel(t('Checked')) diff -u b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php --- b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php @@ -27,18 +27,14 @@ $period = array_map('format_interval', array_combine($intervals, $intervals)); $period[AGGREGATOR_CLEAR_NEVER] = $this->t('Never'); + // @todo: convert to a language selection widget defined in the base field. + // Blocked on https://drupal.org/node/2226493 which adds a generic language widget. $form['langcode'] = array( '#title' => $this->t('Language'), '#type' => 'language_select', '#default_value' => $feed->language()->id, '#languages' => Language::STATE_ALL, - ); - - $form['refresh'] = array('#type' => 'select', - '#title' => $this->t('Update interval'), - '#default_value' => $feed->getRefreshRate(), - '#options' => $period, - '#description' => $this->t('The length of time between feed updates. Requires a correctly configured cron maintenance task.', array('@cron' => url('admin/reports/status'))), + '#weight' => -4, ); return parent::form($form, $form_state, $feed); only in patch2: unchanged: --- a/core/modules/aggregator/aggregator.info.yml +++ b/core/modules/aggregator/aggregator.info.yml @@ -7,3 +7,4 @@ core: 8.x configure: aggregator.admin_settings dependencies: - file + - options