Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_ipaddress_pgsql
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
field_ipaddress_pgsql
Commits
77f357e5
Commit
77f357e5
authored
7 months ago
by
Andrey Vitushkin
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
field_ipaddress_pgsql.install
+26
-0
26 additions, 0 deletions
field_ipaddress_pgsql.install
with
26 additions
and
0 deletions
field_ipaddress_pgsql.install
+
26
−
0
View file @
77f357e5
...
...
@@ -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().
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment