You are here

function node_expire_update_6200 in Node expire 8

Same name and namespace in other branches
  1. 6.2 node_expire.install \node_expire_update_6200()
  2. 7.2 node_expire.install \node_expire_update_6200()
  3. 7 node_expire.install \node_expire_update_6200()

Implements hook_update_N().

Include the max date allowed values. Only new nodes (or edited ones) will be affected

File

./node_expire.install, line 113
Install, uninstall and update the module.

Code

function node_expire_update_6200() {

  // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/node_expire.settings.yml and config/schema/node_expire.schema.yml.
  if ($ntypes = \Drupal::config('node_expire.settings')
    ->get('node_expire_ntypes')) {
    foreach ($ntypes as $ntype => $default) {
      $ntypes[$ntype] = array(
        'default' => $default,
        'max' => '',
      );
    }
    \Drupal::config('node_expire.settings')
      ->set('node_expire_ntypes', $ntypes)
      ->save();
  }

  // $update[]
  // = 'Include the max date allowed values.
  // Only new nodes (or edited ones) will be affected';
  // hook_update_N() no longer returns a $ret array. Instead, return
  // nothing or a translated string indicating the update ran successfully.
  // See http://drupal.org/node/224333#update_sql. /* $update */
  return t('TODO Add a descriptive string here to show in the UI.');
}