Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
geolocation
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
geolocation
Commits
0254a7b3
Commit
0254a7b3
authored
11 months ago
by
Christian Adamski
Committed by
Christian Adamski
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3447082
by drupalviking: Ajax error thrown if no providers are enabled
parent
be0152e4
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!60
Issue #3447082 by drupalviking: Ajax error thrown if no providers are enabled
Pipeline
#194845
passed with warnings
11 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldFormatter/GeolocationMapFormatterBase.php
+14
-2
14 additions, 2 deletions
...ugin/Field/FieldFormatter/GeolocationMapFormatterBase.php
with
14 additions
and
2 deletions
src/Plugin/Field/FieldFormatter/GeolocationMapFormatterBase.php
+
14
−
2
View file @
0254a7b3
...
...
@@ -88,7 +88,6 @@ abstract class GeolocationMapFormatterBase extends FormatterBase {
$container
->
get
(
'plugin.manager.geolocation.mapprovider'
),
$container
->
get
(
'plugin.manager.geolocation.mapcenter'
),
$container
->
get
(
'plugin.manager.geolocation.dataprovider'
),
$container
->
get
(
'plugin.manager.geolocation.datalayerprovider'
),
);
}
...
...
@@ -325,13 +324,26 @@ abstract class GeolocationMapFormatterBase extends FormatterBase {
}
}
return
array_replace_recursive
(
$summary
,
$this
->
mapProvider
->
getSettingsSummary
(
$settings
[
'map_provider_settings'
]));
if
(
$this
->
mapProvider
??
NULL
)
{
return
array_replace_recursive
(
$summary
,
$this
->
mapProvider
->
getSettingsSummary
(
$settings
[
'map_provider_settings'
]));
}
$summary
[]
=
$this
->
t
(
'Attention: No map provider set.'
);
\Drupal
::
messenger
()
->
addWarning
(
'Geolocation Formatter - Map: No map provider set. Map cannot be displayed.'
);
return
$summary
;
}
/**
* {@inheritdoc}
*/
public
function
viewElements
(
FieldItemListInterface
$items
,
$langcode
):
array
{
if
(
!
(
$this
->
mapProvider
??
NULL
))
{
\Drupal
::
logger
(
'geolocation'
)
->
warning
(
'No map provider set. No map can be displayed.'
);
return
[];
}
if
(
$items
->
count
()
==
0
)
{
return
[];
}
...
...
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