Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
digit-joinup-reference
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ec-europa
digit-joinup-reference
Commits
a524eb21
Commit
a524eb21
authored
7 months ago
by
Claudiu Cristea
Browse files
Options
Downloads
Patches
Plain Diff
ISAICP-9013: Fix the ID redirector.
parent
d2a4fe21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!182
Release v1.111.1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/modules/custom/joinup_core/src/Controller/IdRedirect.php
+10
-15
10 additions, 15 deletions
web/modules/custom/joinup_core/src/Controller/IdRedirect.php
with
10 additions
and
15 deletions
web/modules/custom/joinup_core/src/Controller/IdRedirect.php
+
10
−
15
View file @
a524eb21
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
namespace
Drupal\joinup_core\Controller
;
namespace
Drupal\joinup_core\Controller
;
use
Drupal\Core\Controller\ControllerBase
;
use
Drupal\Core\Controller\ControllerBase
;
use
Drupal\joinup_
distribution
\Entity\Distribution
;
use
Drupal\joinup_
rdf
\Entity\RdfSyncEntityInterface
;
use
Drupal\joinup_
licence
\Entity\Licen
ce
;
use
Drupal\joinup_
solution
\Entity\SolutionInterfa
ce
;
use
Drupal\rdf_sync
\RdfSyncMapper
;
use
Drupal\rdf_sync
\RdfSyncMapper
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
@@ -56,21 +56,16 @@ public function redirectToRdfEntity(string $namespace, string $uuid): RedirectRe
...
@@ -56,21 +56,16 @@ public function redirectToRdfEntity(string $namespace, string $uuid): RedirectRe
$uuid
=
urldecode
(
$uuid
);
$uuid
=
urldecode
(
$uuid
);
$id
=
"http://data.europa.eu/
$namespace
/
$uuid
"
;
$id
=
"http://data.europa.eu/
$namespace
/
$uuid
"
;
if
(
$entity_type_id
===
'taxonomy_term'
)
{
if
(
!
$term
=
$this
->
mapper
->
getEntityByUri
(
$id
))
{
return
$this
->
redirect
(
'joinup_core.not_found'
);
}
$id
=
$term
->
id
();
}
// @todo This a temporary solution during conversion of RDF entities to
// @todo This a temporary solution during conversion of RDF entities to
// nodes. Convert to a stable solution in ISAICP-8376.
// nodes. Convert to a stable solution in ISAICP-8376.
else
if
(
$
licence
=
Licence
::
load
ByUri
(
$id
))
{
if
(
$
entity
=
$this
->
mapper
->
getEntity
ByUri
(
$id
))
{
$entity_type_id
=
'node'
;
// @todo Remove the solution stub exception in ISAICP-8572.
$id
=
$licence
->
id
();
if
(
!
$entity
instanceof
SolutionInterface
)
{
}
assert
(
$entity
instanceof
RdfSyncEntityInterface
);
elseif
(
$distribution
=
Distribution
::
loadByUri
(
$id
))
{
$entity_type_id
=
$entity
->
getEntityTypeId
();
$entity_type_id
=
'node'
;
$id
=
$entity
->
id
()
;
$id
=
$distribution
->
id
();
}
}
}
return
$this
->
redirect
(
"entity.
$entity_type_id
.canonical"
,
[
return
$this
->
redirect
(
"entity.
$entity_type_id
.canonical"
,
[
...
...
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