View source
<?php
use Drupal\acquia_lift\Service\Helper\SettingsHelper;
use Drupal\Core\Url;
function acquia_lift_requirements($phase) {
$requirements = [];
if ($phase !== 'runtime') {
return $requirements;
}
$credentialSettings = \Drupal::config('acquia_lift.settings')
->get('credential');
if (!SettingsHelper::isInvalidCredential($credentialSettings)) {
return $requirements;
}
$requirements['acquia_lift_credential'] = [
'title' => t('Acquia Lift module'),
'description' => t('Acquia Lift module has not been fully configured yet. Please configure its settings from the <a href=":url">Acquia Lift Settings page</a>.', [
':url' => Url::fromRoute('acquia_lift.admin_settings_form')
->toString(),
]),
'severity' => REQUIREMENT_WARNING,
'value' => t('Incomplete or invalid credential'),
];
return $requirements;
}
function acquia_lift_update_8400() {
$config = Drupal::configFactory()
->getEditable('acquia_lift.settings');
$config
->clear('credential.oauth_url');
$config
->clear('credential.content_origin');
if ($config
->get('advanced.content_replacement_mode') == 'untrusted') {
$config
->set('advanced.content_replacement_mode', 'trusted');
}
$config
->save();
}