Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
drupal-make
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Dehlan
drupal-make
Commits
59f64d9a
Commit
59f64d9a
authored
Apr 1, 2018
by
ekes
Browse files
Options
Downloads
Patches
Plain Diff
Actually fixes #200 adds label_field => label_value to API
However ideally we only do this with a API version increment.
parent
92ad287d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/radar/radar_services/plugins/services_entity/resource_controller.inc
+13
-0
13 additions, 0 deletions
..._services/plugins/services_entity/resource_controller.inc
with
13 additions
and
0 deletions
modules/radar/radar_services/plugins/services_entity/resource_controller.inc
+
13
−
0
View file @
59f64d9a
...
@@ -177,6 +177,19 @@ class RadarServicesEntityResourceController extends ServicesEntityResourceContro
...
@@ -177,6 +177,19 @@ class RadarServicesEntityResourceController extends ServicesEntityResourceContro
// For referenced entities only return the URI.
// For referenced entities only return the URI.
if
(
$id
=
$property
->
getIdentifier
())
{
if
(
$id
=
$property
->
getIdentifier
())
{
$data
[
$name
]
=
$this
->
get_resource_reference
(
$property
->
type
(),
$id
);
$data
[
$name
]
=
$this
->
get_resource_reference
(
$property
->
type
(),
$id
);
// So in common with some of our other errors the entity won't load
// here as it's a UUID. Replacing the entity controller would
// probably do it? For now fix the issue at hand.
$entity_info
=
entity_get_info
(
$property
->
type
());
$entities
=
entity_uuid_load
(
$property
->
type
(),
[
$id
]);
$entity_label
=
empty
(
$entity_info
[
'entity keys'
][
'label'
])
?
'label'
:
$entity_info
[
'entity keys'
][
'label'
];
if
(
!
empty
(
$entities
))
{
$entity
=
reset
(
$entities
);
$data
[
$name
][
$entity_label
]
=
entity_label
(
$property
->
type
(),
$entity
);
}
else
{
$data
[
$name
][
$entity_label
]
=
''
;
}
}
}
}
}
elseif
(
$property
instanceof
EntityValueWrapper
)
{
elseif
(
$property
instanceof
EntityValueWrapper
)
{
...
...
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