You are here

function wysiwyg_update_7205 in Wysiwyg 7.2

Check for profiles without add_to_summaries settings.

File

./wysiwyg.install, line 455
Installation functions for Wysiwyg module.

Code

function wysiwyg_update_7205() {
  $query = db_select('wysiwyg', 'w');
  $query
    ->join('filter_format', 'f', 'w.format = f.format');
  $query
    ->fields('w', array(
    'format',
    'editor',
    'settings',
  ));
  $query
    ->fields('f', array(
    'name',
  ));
  foreach ($query
    ->execute() as $profile) {
    $settings = unserialize($profile->settings);
    if (!isset($settings['_profile_preferences']['add_to_summaries'])) {
      $values = array(
        '@format' => $profile->name,
        '!url' => 'https://www.drupal.org/node/2851313',
      );
      drupal_set_message(t('You may need to manually resave the Wysiwyg profile configuration tied to the @format text format. See !url', $values), 'warning');
    }
  }
}