Skip to content

Commit 112adb7

Browse files
authored
Merge pull request #27 from dof-dss/development
Unity release 0.30.3
2 parents 0991b3a + 94a347c commit 112adb7

File tree

7 files changed

+27
-20
lines changed

7 files changed

+27
-20
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
name: Fetch phpcs and dependencies
1515
command: |
1616
composer require drupal/coder --prefer-stable --no-interaction --optimize-autoloader
17-
composer require slevomat/coding-standard --prefer-stable --no-interaction --optimize-autoloader
1817
# Move vendor directory up a level as we don't want to code-check all of that.
1918
mv vendor ../
2019
- run:
@@ -36,6 +35,7 @@ jobs:
3635
name: Add OS and PHP extensions/config
3736
command: |
3837
sudo cp /home/circleci/origins_modules/.circleci/docker-php-circleci.ini /usr/local/etc/php/conf.d/
38+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
3939
sudo apt --allow-releaseinfo-change update
4040
sudo apt install -y libpng-dev
4141
sudo docker-php-ext-install gd

cookie_content_blocker/src/Plugin/CKEditorPlugin/CookieContentBlocker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CookieContentBlocker extends CKEditorPluginBase implements CKEditorPluginC
3939
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
4040
parent::__construct($configuration, $plugin_id, $plugin_definition);
4141
// Remove this deprecated code ('drupal_get_path')
42-
//$this->modulePath = drupal_get_path('module', 'cookie_content_blocker');
42+
// $this->modulePath = drupal_get_path('module', 'cookie_content_blocker');
4343
// Replace with a call to a Drupal service, which is not done in the correct way
4444
// using Dependency Injection, but that would involve a lot of work and this is just
4545
// a quick fix to this contrib module in order to get it through our CI checks.

cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use function in_array;
1414
use function is_callable;
1515
use function uasort;
16-
use Drupal;
1716
use Drupal\Component\Utility\Crypt;
1817
use Drupal\Component\Utility\Html;
1918
use Drupal\Component\Utility\NestedArray;
@@ -105,7 +104,9 @@ public function __construct(BlockedLibraryManagerInterface $library_manager, Ass
105104
* The settings to merge.
106105
*/
107106
protected function mergeSettings(array $settings): void {
108-
self::$drupalSettings = NestedArray::mergeDeepArray([self::$drupalSettings, $settings], TRUE);
107+
self::$drupalSettings = NestedArray::mergeDeepArray([
108+
self::$drupalSettings, $settings
109+
], TRUE);
109110
}
110111

111112
/**
@@ -182,7 +183,10 @@ private function generateAssetPlaceholder(array $asset): array {
182183

183184
// Merge attached settings back into the original assets.
184185
$placeholder_asset = AttachedAssets::createFromRenderArray($attached);
185-
$this->allowedAssets->setSettings(NestedArray::mergeDeepArray([$placeholder_asset->getSettings(), $this->allowedAssets->getSettings()], TRUE));
186+
$this->allowedAssets->setSettings(NestedArray::mergeDeepArray([
187+
$placeholder_asset->getSettings(),
188+
$this->allowedAssets->getSettings()
189+
], TRUE));
186190
$this->mergeSettings(['data' => $this->allowedAssets->getSettings()]);
187191
return $placeholder;
188192
}
@@ -195,7 +199,9 @@ private function generateAssetPlaceholder(array $asset): array {
195199
*/
196200
private function getCssAssetCollection(): array {
197201
$optimize_css = !defined('MAINTENANCE_MODE') && $this->config->get('css.preprocess');
198-
return $this->getMergedAndSortedAssets(...$this->resolveAssets([$this->assetResolver, 'getCssAssets'], $optimize_css));
202+
return $this->getMergedAndSortedAssets(...$this->resolveAssets([
203+
$this->assetResolver, 'getCssAssets'
204+
], $optimize_css));
199205
}
200206

201207
/**

unity_breadcrumbs/unity_breadcrumbs.module

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ use Drupal\Core\Link;
1515
*
1616
* Altering the search view page breadcrumbs, when facets are selected the breadcrumb trail is overwritten.
1717
*/
18-
function unity_breadcrumbs_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInterface $route_match, array
19-
$context) {
18+
function unity_breadcrumbs_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInterface $route_match, array $context) {
2019
$links = $breadcrumb->getLinks();
2120

22-
if ($links) {
21+
if (!empty($links)) {
2322
// Loop through the links for links that have facet queries added to them and unset the link of the last breadcrumb.
2423
// The facets module breadcrumb links them all by default.
2524
foreach ($links as $link) {

unity_landing_pages/unity_landing_pages.module

-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,3 @@ function unity_landing_pages_preprocess_page(&$variables) {
8787
$variables['#attached']['library'][] = 'unity_landing_pages/landing_page_admin';
8888
}
8989
}
90-

unity_search_pages/src/Controller/SearchPagesController.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,21 @@ public function getTitle($route = NULL) {
9393
* The page title.
9494
*/
9595
public function getTitleFromRoute($route = NULL) {
96-
// For example, route
97-
// view.publications_search.publication_search_page
96+
// For example, route view.publications_search.publication_search_page
9897
// gives the title 'Publications'.
99-
$title = "";
98+
$title = '';
10099
$route_parts = explode('.', $route);
101-
if ((count($route_parts) > 2) && isset($route_parts[2])) {
100+
if ((count($route_parts) > 2) && !empty($route_parts[2])) {
102101
$title = $route_parts[2];
103-
$title = str_replace(['search_page','_'],'',$title);
102+
$title = str_replace(['search_page', '_'], '', $title);
104103
if (strlen($title) == 0) {
105104
// This must be the site search page.
106105
$title = 'Search';
107-
} else {
106+
}
107+
else {
108108
// Capitalise the first letter and pluralise.
109109
$title = ucfirst($title);
110-
if ((substr($title, -1) != 's') && ($title !== 'Evidence') ) {
110+
if ((substr($title, -1) != 's') && ($title !== 'Evidence')) {
111111
$title .= 's';
112112
}
113113
}

unity_search_pages/unity_search_pages.module

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use Solarium\Core\Query\QueryInterface;
99
use Drupal\search_api\Query\QueryInterface as SearchApiQueryInterface;
1010
use Drupal\Core\Language\Language;
1111
use Drupal\Component\Utility\Html;
12-
use \Drupal\Core\StringTranslation\TranslatableMarkup;
12+
use Drupal\Core\StringTranslation\TranslatableMarkup;
1313

1414
/**
1515
* Implements hook_preprocess_views_view() for views_view.
@@ -169,11 +169,14 @@ function unity_search_pages_preprocess_page_title(&$variables) {
169169
if (preg_match($pattern, $current_route)) {
170170
if ($title_raw instanceof TranslatableMarkup) {
171171
$title_text = $title_raw->render();
172-
} elseif (is_array($title_raw) && isset($title_raw['#markup'])) {
172+
}
173+
elseif (is_array($title_raw) && isset($title_raw['#markup'])) {
173174
$title_text = $title_raw['#markup'];
174-
} else {
175+
}
176+
else {
175177
$title_text = $title_raw;
176178
}
179+
177180
if (preg_match('/\w*\b\s- search results/', $title_text)) {
178181
$new_title = strtok($title_text, ' -');
179182
$variables['title'] = t($new_title);

0 commit comments

Comments
 (0)