Skip to content

Commit f8b606e

Browse files
author
Johan Gant
committed
Merge branch 'development'
2 parents 112adb7 + b9942e2 commit f8b606e

16 files changed

+34
-28
lines changed

cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private function getJsAssetCollection(string $region): array {
220220
return $$region ?? [];
221221
}
222222

223-
$optimize_js = !defined('MAINTENANCE_MODE') && !Drupal::state()->get('system.maintenance_mode') && $this->config->get('js.preprocess');
223+
$optimize_js = !defined('MAINTENANCE_MODE') && !\Drupal::state()->get('system.maintenance_mode') && $this->config->get('js.preprocess');
224224
[
225225
[$allowed_js_assets_header, $allowed_js_assets_footer],
226226
[$allowed_js_assets_header_raw, $allowed_js_assets_footer_raw],

unity_breadcrumbs/src/ConsultationBreadcrumb.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class ConsultationBreadcrumb implements BreadcrumbBuilderInterface {
5252
protected $titleResolver;
5353

5454
/**
55-
* Symfony\Component\HttpFoundation\RequestStack definition.
55+
* RequestStack service object.
5656
*
57-
* @var Symfony\Component\HttpFoundation\RequestStack
57+
* @var \Symfony\Component\HttpFoundation\RequestStack
5858
*/
5959
protected $request;
6060

unity_breadcrumbs/src/EvidenceBreadcrumb.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class EvidenceBreadcrumb implements BreadcrumbBuilderInterface {
5252
protected $titleResolver;
5353

5454
/**
55-
* Symfony\Component\HttpFoundation\RequestStack definition.
55+
* RequestStack service object.
5656
*
57-
* @var Symfony\Component\HttpFoundation\RequestStack
57+
* @var \Symfony\Component\HttpFoundation\RequestStack
5858
*/
5959
protected $request;
6060

unity_breadcrumbs/src/NewsBreadcrumb.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class NewsBreadcrumb implements BreadcrumbBuilderInterface {
5252
protected $titleResolver;
5353

5454
/**
55-
* Symfony\Component\HttpFoundation\RequestStack definition.
55+
* RequestStack service object.
5656
*
57-
* @var Symfony\Component\HttpFoundation\RequestStack
57+
* @var \Symfony\Component\HttpFoundation\RequestStack
5858
*/
5959
protected $request;
6060

unity_breadcrumbs/src/PageBreadcrumb.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Drupal\Core\Entity\EntityTypeManagerInterface;
2121
use Drupal\Core\Routing\RouteMatchInterface;
2222
use Drupal\Core\Link;
23-
use Drupal\Core\Url;
2423
use Drupal\node\NodeInterface;
2524
use Symfony\Component\DependencyInjection\ContainerInterface;
2625
use Symfony\Component\HttpFoundation\RequestStack;
@@ -50,9 +49,9 @@ class PageBreadcrumb implements BreadcrumbBuilderInterface {
5049
protected $titleResolver;
5150

5251
/**
53-
* Symfony\Component\HttpFoundation\RequestStack definition.
52+
* RequestStack service object.
5453
*
55-
* @var Symfony\Component\HttpFoundation\RequestStack
54+
* @var \Symfony\Component\HttpFoundation\RequestStack
5655
*/
5756
protected $request;
5857

unity_breadcrumbs/src/PublicationBreadcrumb.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class PublicationBreadcrumb implements BreadcrumbBuilderInterface {
5252
protected $titleResolver;
5353

5454
/**
55-
* Symfony\Component\HttpFoundation\RequestStack definition.
55+
* RequestStack service object.
5656
*
57-
* @var Symfony\Component\HttpFoundation\RequestStack
57+
* @var \Symfony\Component\HttpFoundation\RequestStack
5858
*/
5959
protected $request;
6060

unity_breadcrumbs/src/ViewPageBreadcrumb.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Drupal\Core\Controller\TitleResolverInterface;
1919
use Drupal\Core\Routing\RouteMatchInterface;
2020
use Drupal\Core\Link;
21-
use Drupal\Core\Url;
2221
use Symfony\Component\DependencyInjection\ContainerInterface;
2322
use Symfony\Component\HttpFoundation\RequestStack;
2423

@@ -28,9 +27,9 @@
2827
class ViewPageBreadcrumb implements BreadcrumbBuilderInterface {
2928

3029
/**
31-
* Symfony\Component\HttpFoundation\RequestStack definition.
30+
* RequestStack service object.
3231
*
33-
* @var Symfony\Component\HttpFoundation\RequestStack
32+
* @var \Symfony\Component\HttpFoundation\RequestStack
3433
*/
3534
protected $request;
3635

unity_breadcrumbs/src/WebformBreadcrumb.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Drupal\Core\Entity\EntityTypeManagerInterface;
2121
use Drupal\Core\Routing\RouteMatchInterface;
2222
use Drupal\Core\Link;
23-
use Drupal\Core\Url;
2423
use Drupal\node\NodeInterface;
2524
use Symfony\Component\DependencyInjection\ContainerInterface;
2625
use Symfony\Component\HttpFoundation\RequestStack;
@@ -52,7 +51,7 @@ class WebformBreadcrumb implements BreadcrumbBuilderInterface {
5251
/**
5352
* Symfony\Component\HttpFoundation\RequestStack definition.
5453
*
55-
* @var Symfony\Component\HttpFoundation\RequestStack
54+
* @var \Symfony\Component\HttpFoundation\RequestStack
5655
*/
5756
protected $request;
5857

unity_breadcrumbs/unity_breadcrumbs.module

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
use Drupal\Core\Breadcrumb\Breadcrumb;
99
use Drupal\Core\Routing\RouteMatchInterface;
10+
use Drupal\Core\StringTranslation\TranslatableMarkup;
1011
use Drupal\Core\Url;
11-
use Drupal\Core\Link;
1212

1313
/**
1414
* Implements hook_system_breadcrumb_alter().

unity_common/src/Commands/UnityDrushCommands.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function contentPurge($content_type = NULL) {
146146
// Ask user to confirm.
147147
if ($this->io()->confirm("Are you sure you want to delete all $content_type content", TRUE)) {
148148
$storage->delete($entities);
149-
$this->io()->write("<comment>$bundle content deleted</comment>", TRUE);
149+
$this->io()->write("<comment>$content_type content deleted</comment>", TRUE);
150150
}
151151
}
152152

unity_common/src/EventSubscriber/UpdateConfigAfterImport.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class UpdateConfigAfterImport implements EventSubscriberInterface {
1919
/**
2020
* The upadte config from env service.
2121
*
22-
* @var Drupal\unity_common\UpdateConfigFromEnvironment
22+
* @var \Drupal\unity_common\UpdateConfigFromEnvironment
2323
*/
2424
protected $updateEnvService;
2525

2626
/**
2727
* Constructs a new UpdateConfigAfterImport instance.
2828
*
29-
* @param Drupal\unity_common\UpdateConfigFromEnvironment $update_service
29+
* @param \Drupal\unity_common\UpdateConfigFromEnvironment $update_service
3030
* The entity type manager.
3131
*/
3232
public function __construct(UpdateConfigFromEnvironment $update_service) {

unity_common/unity_common.module

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function unity_common_form_alter(&$form, FormStateInterface $form_state, $form_i
4646
if (preg_match('/webform/', $form_id)) {
4747
if (\Drupal::moduleHandler()->moduleExists('honeypot')) {
4848
// Add in a hidden honeypot field to all webforms.
49-
honeypot_add_form_protection(
49+
\Drupal::service('honeypot')->addFormProtection(
5050
$form,
5151
$form_state,
5252
['honeypot', 'time_restriction']

unity_file_migrations/src/MigrationProcessors.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Drupal\Core\Database\Driver\mysql\Connection;
77
use Drupal\Core\Entity\EntityTypeManagerInterface;
88
use Drupal\Console\Core\Style\DrupalStyle;
9+
use Drupal\node\NodeInterface;
910
use Drush\Commands\DrushCommands;
1011

1112
/**
@@ -123,9 +124,11 @@ public function processNodeStatus(int $nid, string $status) {
123124
// Make the revision current and publish if necessary.
124125
$revision = $this->nodeStorage->loadRevision($vid);
125126
if (!empty($revision)) {
127+
/** @var \Drupal\Core\Entity\EditorialContentEntityBase $revision */
126128
$revision->isDefaultRevision(TRUE);
129+
127130
if ($status == 1) {
128-
$revision->setpublished();
131+
$revision->setPublished();
129132
}
130133
$revision->save();
131134
}
@@ -134,7 +137,7 @@ public function processNodeStatus(int $nid, string $status) {
134137
if ($status == 1) {
135138
// If node was published on D7, make sure that it is published on D8.
136139
$node = $this->nodeStorage->load($nid);
137-
if (!empty($node)) {
140+
if ($node instanceof NodeInterface) {
138141
$node->status = 1;
139142
$node->set('moderation_state', 'published');
140143
$node->save();
@@ -146,9 +149,11 @@ public function processNodeStatus(int $nid, string $status) {
146149
select state from {workbench_moderation_node_history}
147150
where hid = (select max(hid) from {workbench_moderation_node_history} where nid = :nid)
148151
", [':nid' => $nid])->fetchField();
152+
149153
if ($moderation_status == 'needs_review') {
150154
// Make sure state is 'needs review' on D8.
151155
$node = $this->nodeStorage->load($nid);
156+
/** @var \Drupal\node\NodeInterface $node */
152157
$node->set('moderation_state', 'needs_review');
153158
$node->save();
154159
}

unity_file_migrations/src/Plugin/migrate/process/MediaWysiwygFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Symfony\Component\Serializer\Encoder\JsonDecode;
1111
use Symfony\Component\Serializer\Encoder\JsonEncoder;
1212
use Drupal\Core\Database\Connection;
13+
use Symfony\Component\Serializer\Exception\NotEncodableValueException;
1314

1415
/**
1516
* Processes [[{"type":"media","fid":"1234",...}]] tokens in content.

unity_internal_link_checker/unity_internal_link_checker.module

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function unity_internal_link_checker_entity_presave(EntityInterface $entity) {
1919
}
2020
if ($entity instanceof ContentEntityInterface) {
2121
if ($entity->hasField('body')) {
22-
$body = $entity->get('body')->value;
23-
$format = $entity->get('body')->format;
22+
$body = $entity->get('body')->value ?? '';
23+
$format = $entity->get('body')->format ?? '';
2424

2525
$matches = [];
2626
// Look for all anchors in the body field.
@@ -37,7 +37,8 @@ function unity_internal_link_checker_entity_presave(EntityInterface $entity) {
3737
$body = _convert_absolute_link($body, $original_link);
3838
}
3939
}
40-
$entity->body->setValue(['value' => $body, 'format' => $format]);
40+
41+
$entity->set('body', ['value' => $body, 'format' => $format]);
4142
}
4243
}
4344
}

unity_search_pages/unity_search_pages.module

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Custom code for search pages.
66
*/
77

8+
use Drupal\Core\Language\LanguageInterface;
89
use Solarium\Core\Query\QueryInterface;
910
use Drupal\search_api\Query\QueryInterface as SearchApiQueryInterface;
1011
use Drupal\Core\Language\Language;
@@ -194,5 +195,6 @@ function unity_search_pages_preprocess_page_title(&$variables) {
194195
*/
195196
function unity_search_pages_search_api_solr_query_alter(QueryInterface $solarium_query, SearchApiQueryInterface $query) {
196197
// Maps to <str name="name">spelling_und</str> in solrconfig_extra.xml.
197-
$solarium_query->getSpellcheck()->setDictionary(Language::LANGCODE_NOT_SPECIFIED);
198+
/** @var \Solarium\QueryType\Select\Query\Query $solarium_query */
199+
$solarium_query->getSpellcheck()->setDictionary(LanguageInterface::LANGCODE_NOT_SPECIFIED);
198200
}

0 commit comments

Comments
 (0)