Skip to content
Snippets Groups Projects
Commit 2edaee85 authored by Zoltan Horvath's avatar Zoltan Horvath
Browse files

Merge branch 'ISAICP-8664' into 'patch/v1.104.1'

ISAICP-8664: Fix PHP error in joinup_modal_anonymous.

See merge request digit/digit-joinup-dev!1297
parents 05a62743 f8a82ab9
No related branches found
Tags v1.104.1
1 merge request!168Patch release v1.104.1
......@@ -15,7 +15,7 @@ function github_feed_theme(array $existing, string $type, string $theme, string
'github_feed' => [
'variables' => [
'url' => NULL,
'type' => NULL,
'feed_type' => NULL,
'items' => NULL,
],
],
......@@ -52,7 +52,7 @@ function github_feed_theme(array $existing, string $type, string $theme, string
* Implements template_preprocess_HOOK().
*/
function template_preprocess_github_feed(array &$variables): void {
switch ($variables['type']) {
switch ($variables['feed_type']) {
case 'issue':
$variables['type_parsed'] = t('Issues');
$variables['icon_id'] = 'info-circle';
......
......@@ -90,7 +90,7 @@ public function viewElements(FieldItemListInterface $items, $langcode): array {
$element[$delta] = [
'#theme' => 'github_feed',
'#url' => $item->repository,
'#type' => $item->type,
'#feed_type' => $item->type,
'#cache' => [
'max-age' => $this->getFieldSetting('cache_max_age'),
],
......
......@@ -3,7 +3,7 @@
* Variables:
* - items: The feed object.
* - url: The url of the feed.
* - type: The type of the feed.
* - feed_type: The type of the feed.
#}
<div class="github-feed">
<h3>{{ "Items of type"|t }} "{{ type_parsed }}" {{ "from"|t }} {{ url }}:</h3>
......
......@@ -14,7 +14,6 @@ function joinup_modal_theme(): array {
return [
'joinup_modal_anonymous' => [
'variables' => [
'type' => NULL,
'title' => NULL,
'description' => NULL,
'login' => NULL,
......@@ -23,12 +22,3 @@ function joinup_modal_theme(): array {
],
];
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function joinup_modal_theme_suggestions_joinup_modal_anonymous(array $variables): array {
return [
'joinup_modal_anonymous__' . $variables['type'],
];
}
......@@ -30,8 +30,7 @@ public function render(string $type): array {
'query' => $this->getDestinationArray(),
]);
return [
'#theme' => 'joinup_modal_anonymous',
'#type' => $type,
'#theme' => "joinup_modal_anonymous__$type",
'#title' => $this->t('You are not signed in'),
'#login' => new Link('Sign in', $login),
// Replicate logic of "Create an account" from navigation, it points
......
......@@ -3,7 +3,7 @@
* Variables:
* - items: The feed object.
* - url: The url of the feed.
* - type: The type of the feed.
* - feed_type: The type of the feed.
#}
<div class="github-feed mb-4">
<h4 class="mb-3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment