Skip to content
Snippets Groups Projects
Commit 77f357e5 authored by Andrey Vitushkin's avatar Andrey Vitushkin
Browse files

Issue #3456272: Include no PostgreSQL module/database notification in Status Report

parent aef992a0
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,32 @@
declare(strict_types=1);
/**
* Implements hook_requirements().
*
* Check if PostgreSQL is being used, and if not, add to the Status report a
* message that Network Address Functions and Operators will not be available.
*/
function field_ipaddress_pgsql_requirements($phase) {
$requirements = [];
if ($phase === 'runtime') {
if (\Drupal::database()->driver() !== 'pgsql') {
$url = 'https://www.postgresql.org/docs/16/functions-net.html#FUNCTIONS-NET';
$message = t('PostgreSQL is not detected, so <a href=":url" target="_blank">Network Address Functions and Operators</a> provided by PostgreSQL will not be available.', [
':url' => $url,
]);
$requirements['pgsql'] = [
'title' => t('Field IP address PostgreSQL'),
'severity' => REQUIREMENT_WARNING,
'description' => $message,
];
}
}
return $requirements;
}
/**
* Implements hook_install().
*
......
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