Problem/Motivation

This module is still calling variable_get() in the code, which doesn't exist anymore. It also uses functions that don't exist, such as ultimate_cron_job_load(), ultimate_cron_job_get_status(), ultimate_cron_job_set_status(), module_implements(), etc.

Many of these are in QueueSettings.php

It'd also be nice if the module worked towards Drupal coding standards compliance (such as using short array syntax and using doc comments). Something as simple as running drupalmoduleupgrader and phpcs or phpcbf would help a bunch.

Comments

solideogloria created an issue. See original summary.

guilhermevp’s picture

Assigned: Unassigned » guilhermevp
guilhermevp’s picture

Assigned: guilhermevp » Unassigned

Module is stated as Drupal9 compatible in #3141993: Automated Drupal Rector fixes

solideogloria’s picture

That doesn't mean that it hasn't been completely converted. Just because it happens to work so far doesn't mean there isn't something broken. Is the QueueSettings.php file unused then? Non-existent functions shouldn't be used in the project, so whether it's working or not, this piece needs to be cleaned up.

When I open this module in VS Code, files from this module are full of errors and standards violations. Here's a piece:

  private function get_queues() {            // Unused private function.
    if (!isset(self::$queues)) {
      $queues = array();
      foreach (module_implements('cron_queue_info') as $module) {   // Undefined function module_implements
        $items = module_invoke($module, 'cron_queue_info');             // Undefined function module_invoke
        if (is_array($items)) {
          foreach ($items as &$item) {
            $item['module'] = $module;
          }
          $queues += $items;
        }
      }
      drupal_alter('cron_queue_info', $queues);   // Undefined function drupal_alter
      self::$queues = $queues;
    }
    return $queues;
  }

  /**
   * Implements hook_cronapi().
   */
  public function cronapi() {
    $items = array(); // Short array syntax must be used to define arrays (Drupal.Arrays.DisallowLongArraySyntax.Found)
    if (!variable_get($this->key . '_enabled', TRUE)) {    // Undefined function variable_get
      return $items;
    }

    // Grab the defined cron queues.
    $queues = self::get_queues();    // Non static method 'get_queues' should not be called statically.
berdir’s picture

Status: Active » Closed (duplicate)

> Many of these are in QueueSettings.php

That is dead, unused code.

Yes, those things would be nice, but this module is only alpha for a reason, sadly I have limited resources to spend on improving it.

Open for specific patches and contributes, but dong code style improvements like this is generally hard, because it is a lot of work to review it and conflicts often with other issues.