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
d291e2a4
Verified
Commit
d291e2a4
authored
2 weeks ago
by
Alexandre Dias
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/develop' into ISAICP-9617
parents
9185d985
f9539813
No related branches found
No related tags found
2 merge requests
!215
Release 2.3.2
,
!214
ISAICP-9579: Fix SearchWidget: refer own submit callbacks precisely to prevent...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/modules/custom/joinup_group/src/Plugin/Condition/GroupContextCondition.php
+9
-8
9 additions, 8 deletions
...inup_group/src/Plugin/Condition/GroupContextCondition.php
with
9 additions
and
8 deletions
web/modules/custom/joinup_group/src/Plugin/Condition/GroupContextCondition.php
+
9
−
8
View file @
d291e2a4
...
@@ -102,11 +102,10 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
...
@@ -102,11 +102,10 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
*/
*/
public
function
submitConfigurationForm
(
array
&
$form
,
FormStateInterface
$form_state
):
void
{
public
function
submitConfigurationForm
(
array
&
$form
,
FormStateInterface
$form_state
):
void
{
// At this point, all groups are valid and filtered.
// At this point, all groups are valid and filtered.
$limit_to_groups
=
$form_state
->
getValue
(
'limit_to_groups'
);
$limit_to_groups
=
$form_state
->
getValue
(
'limit_to_groups'
,
''
);
$groups
=
$this
->
getGroups
(
$limit_to_groups
);
$groups
=
$this
->
getGroups
(
$
this
->
textToArray
(
$
limit_to_groups
)
)
;
$limit_to_groups
=
array_map
(
fn
(
GroupInterface
$group
):
string
=>
$group
->
id
(),
$groups
);
$limit_to_groups
=
array_map
(
fn
(
GroupInterface
$group
):
string
=>
$group
->
id
(),
$groups
);
$this
->
setConfig
(
'limit_to_groups'
,
array_unique
(
$limit_to_groups
));
$this
->
setConfig
(
'limit_to_groups'
,
array_values
(
array_unique
(
$limit_to_groups
)));
$form_state
->
setValue
(
'limit_to_groups'
,
$limit_to_groups
);
parent
::
submitConfigurationForm
(
$form
,
$form_state
);
parent
::
submitConfigurationForm
(
$form
,
$form_state
);
}
}
...
@@ -115,9 +114,10 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
...
@@ -115,9 +114,10 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
*/
*/
public
function
summary
():
?MarkupInterface
{
public
function
summary
():
?MarkupInterface
{
$groups
=
$this
->
getGroups
();
$groups
=
$this
->
getGroups
();
if
(
$groups
)
{
$groupLabels
=
array_map
(
function
(
GroupInterface
$group
):
string
{
if
(
!
empty
(
$groups
))
{
return
$group
->
get
(
'type'
)
->
entity
->
label
()
.
': '
.
$group
->
label
();
$groupLabels
=
array_map
(
function
(
GroupInterface
|
null
$group
):
string
{
return
$group
?
$group
->
get
(
'type'
)
->
entity
->
label
()
.
': '
.
$group
->
label
()
:
'Invalid'
;
},
$groups
);
},
$groups
);
$args
=
[
'@groups'
=>
implode
(
', '
,
$groupLabels
)];
$args
=
[
'@groups'
=>
implode
(
', '
,
$groupLabels
)];
if
(
!
$this
->
isNegated
())
{
if
(
!
$this
->
isNegated
())
{
...
@@ -192,7 +192,8 @@ protected function getGroups(?array $data = NULL): array {
...
@@ -192,7 +192,8 @@ protected function getGroups(?array $data = NULL): array {
// Further attempt to recognize the group from the URL if the ID is
// Further attempt to recognize the group from the URL if the ID is
// a URI and is internal.
// a URI and is internal.
elseif
(
!
UrlHelper
::
isExternal
(
$id
)
||
UrlHelper
::
externalIsLocal
(
$id
,
$this
->
requestStack
->
getCurrentRequest
()
->
getSchemeAndHttpHost
()))
{
elseif
(
!
UrlHelper
::
isExternal
(
$id
)
||
UrlHelper
::
externalIsLocal
(
$id
,
$this
->
requestStack
->
getCurrentRequest
()
->
getSchemeAndHttpHost
()))
{
$url
=
Url
::
fromUri
(
'internal:'
.
UrlHelper
::
parse
(
$id
)[
'path'
]);
$path
=
trim
(
UrlHelper
::
parse
(
$id
)[
'path'
],
'/'
);
$url
=
Url
::
fromUri
(
"internal:/"
.
$path
);
if
(
$url
->
isRouted
()
&&
$url
->
getRouteName
()
===
'entity.node.canonical'
)
{
if
(
$url
->
isRouted
()
&&
$url
->
getRouteName
()
===
'entity.node.canonical'
)
{
$node
=
$this
->
entityTypeManager
->
getStorage
(
'node'
)
->
load
(
$url
->
getRouteParameters
()[
'node'
]);
$node
=
$this
->
entityTypeManager
->
getStorage
(
'node'
)
->
load
(
$url
->
getRouteParameters
()[
'node'
]);
if
(
$node
instanceof
GroupInterface
)
{
if
(
$node
instanceof
GroupInterface
)
{
...
...
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