function PendingUpdatesValidator::validate

Validates that there are no pending database updates.

File

core/modules/package_manager/src/Validator/PendingUpdatesValidator.php, line 36

Class

PendingUpdatesValidator
Validates that there are no pending database updates.

Namespace

Drupal\package_manager\Validator

Code

public function validate(PreOperationStageEvent $event) : void {
    if ($this->updatesExist()) {
        $message = $this->t('Some modules have database updates pending. You should run the <a href=":update">database update script</a> immediately.', [
            ':update' => Url::fromRoute('system.db_update')->toString(),
        ]);
        $event->addError([
            $message,
        ]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.