Commit 1398154d authored by Sascha Grossenbacher's avatar Sascha Grossenbacher Committed by Sascha Grossenbacher
Browse files

Issue #3290211 by Berdir, Project Update Bot, fathima.asmat, bruno.bicudo,...

Issue #3290211 by Berdir, Project Update Bot, fathima.asmat, bruno.bicudo, DieterHolvoet, skrug, hmdnawaz: Automated Drupal 10 compatibility fixes
parent 08af29a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,12 +4,12 @@
  "license": "GPL-2.0+",
  "description": "Ultimate cron",
  "require": {
      "drupal/core": "^8.7.7 || ^9"
      "drupal/core": "^9 || ^10"
  },
  "extra": {
    "drush": {
      "services": {
        "drush.services.yml": "^9 || ^10"
        "drush.services.yml": "^9 || ^10 || ^11"
      }
    }
  }
+7 −1
Original line number Diff line number Diff line
@@ -180,7 +180,13 @@ class CronJobDiscovery {
    $items = array();

    // Add hook_cron() if applicable.
    if ($this->moduleHandler->implementsHook($module, 'cron')) {
    if (method_exists($this->moduleHandler, 'hasImplementations')) {
      $has_implementations = $this->moduleHandler->hasImplementations('cron', $module);
    }
    else {
      $has_implementations = $this->moduleHandler->implementsHook($module, 'cron');
    }
    if ($has_implementations) {
      $info = $this->moduleExtensionList->getExtensionInfo($module);
      $callback = "{$module}_cron";
      $items[$callback] = array(
+2 −2
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ class CronJobListBuilder extends DraggableListBuilder {
   */
  public function buildRow(EntityInterface $entity) {
    /* @var \Drupal\ultimate_cron\CronJobInterface $entity */
    $icon = drupal_get_path('module', 'ultimate_cron') . '/icons/hourglass.png';
    $behind_icon = ['#prefix' => ' ', '#theme' => 'image', '#uri' => file_create_url($icon), '#title' => t('Job is behind schedule!')];
    $icon = \Drupal::service('extension.list.module')->getPath('ultimate_cron') . '/icons/hourglass.png';
    $behind_icon = ['#prefix' => ' ', '#theme' => 'image', '#uri' => \Drupal::service('file_url_generator')->generateAbsoluteString($icon), '#title' => t('Job is behind schedule!')];

    $log_entry = $entity->loadLatestLogEntry();
    $row['label'] = $entity->label();
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

namespace Drupal\ultimate_cron;

class CronPluginMultiple extends \Drupal\ultimate_cron\CronPlugin {
class CronPluginMultiple extends CronPlugin {
  static public $multiple = TRUE;

  /**
+6 −2
Original line number Diff line number Diff line
@@ -477,13 +477,17 @@ class CronJob extends ConfigEntityBase implements CronJobInterface {
      // explicitly here instead. The advantage is that this will not
      // interrupt the process.
      $variables = Error::decodeException($e);
      unset($variables['backtrace']);
      $variables = array_filter($variables, function ($key) {
        return $key[0] == '@' || $key[0] == '%';
      }, ARRAY_FILTER_USE_KEY);
      $log_entry->log('%type: @message in %function (line %line of %file).', $variables, RfcLogLevel::ERROR);
      return FALSE;
    }
    catch (\Exception $e) {
      $variables = Error::decodeException($e);
      unset($variables['backtrace']);
      $variables = array_filter($variables, function ($key) {
        return $key[0] == '@' || $key[0] == '%';
      }, ARRAY_FILTER_USE_KEY);
      $log_entry->log('%type: @message in %function (line %line of %file).', $variables, RfcLogLevel::ERROR);
      return FALSE;
    }
Loading