Skip to content
Snippets Groups Projects
Unverified Commit 32a13379 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2422681 by berdir, catch, ressa, nicxvan, alexpott, longwave: Remove...

Issue #2422681 by berdir, catch, ressa, nicxvan, alexpott, longwave: Remove the automatic cron run from the installer
parent b36a4fc5
No related branches found
No related tags found
4 merge requests!11197Issue #3506427 by eduardo morales alberti: Remove responsive_image.ajax from hook,!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!617Issue #3043725: Provide a Entity Handler for user cancelation
Pipeline #388365 passed with warnings
Pipeline: drupal

#388386

    Pipeline: drupal

    #388376

      Pipeline: drupal

      #388369

        ......@@ -1910,11 +1910,6 @@ function install_finished(&$install_state) {
        // installer does not use an HttpKernel, that event is never triggered.
        \Drupal::service('router.builder')->rebuild();
        // Run cron to populate update status tables (if available) so that users
        // will be warned if they've installed an out of date Drupal version.
        // Will also trigger indexing of profile-supplied content or feeds.
        \Drupal::service('cron')->run();
        if ($install_state['interactive']) {
        // Load current user and perform final login tasks.
        // This has to be done after drupal_flush_all_caches()
        ......
        ......@@ -111,7 +111,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
        '#value' => $this->t('Run cron'),
        '#submit' => ['::runCron'],
        ];
        $status = '<p>' . $this->t('Last run: %time ago.', ['%time' => $this->dateFormatter->formatTimeDiffSince($this->state->get('system.cron_last'))]) . '</p>';
        if ($time_ago = $this->state->get('system.cron_last')) {
        $status = '<p>' . $this->t('Last run: %time ago.', ['%time' => $this->dateFormatter->formatTimeDiffSince($time_ago)]) . '</p>';
        }
        else {
        $status = '<p>' . $this->t('Last run: never') . '</p>';
        }
        $form['status'] = [
        '#markup' => $status,
        ];
        ......
        ......@@ -120,11 +120,17 @@ public function testCronExceptions(): void {
        public function testCronUI(): void {
        $admin_user = $this->drupalCreateUser(['administer site configuration']);
        $this->drupalLogin($admin_user);
        \Drupal::state()->delete('system.cron_last');
        $this->drupalGet('admin/config/system/cron');
        // Don't use REQUEST to calculate the exact time, because that will
        // fail randomly. Look for the word 'years', because without a timestamp,
        // the time will start at 1 January 1970.
        $this->assertSession()->pageTextNotContains('years');
        // Check that cron has never run.
        $this->assertSession()->pageTextContains('Last run: never');
        // Now check that it has run.
        // Sleep to allow cron time to complete since it happens during kernel
        // terminate after the page response is set.
        sleep(3);
        $this->drupalGet('admin/config/system/cron');
        $this->assertSession()->pageTextNotContains('Last run: never');
        $cron_last = time() - 200;
        \Drupal::state()->set('system.cron_last', $cron_last);
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment