Skip to content

Commit d527119

Browse files
authored
Merge pull request #910 from UN-OCHA/release-versions/v1.7.2
release versions/v1.7.2
2 parents 2ae138b + 1a78621 commit d527119

File tree

18 files changed

+51
-30
lines changed

18 files changed

+51
-30
lines changed

.docksal/docksal.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,9 @@ services:
5353
volumes:
5454
- ${PROJECT_ROOT}/.docksal/etc/solr/solr811:/opt/solr/server/solr/configsets/solr811
5555
environment:
56-
SOLR_CORE: ${SOLR_CORE:-ghi}
56+
SOLR_CORE: ${SOLR_CORE:-ghi}
57+
58+
memcached:
59+
extends:
60+
file: ${HOME}/.docksal/stacks/services.yml
61+
service: memcached

config/core.entity_form_display.node.article.default.yml

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ third_party_settings:
6060
children:
6161
- field_remote_article
6262
- field_image
63-
- field_chapter
6463
- field_summary
6564
- field_tags
6665
label: 'Remote article'

config/imagemagick.settings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ path_to_binaries: ''
66
prepend: ''
77
log_warnings: true
88
debug: false
9-
locale: en_US.UTF-8
109
image_formats:
1110
PNG:
1211
mime_type: image/png
@@ -59,3 +58,4 @@ advanced:
5958
colorspace: '0'
6059
profile: ''
6160
coalesce: false
61+
locale: en_US.UTF-8

html/modules/custom/ghi_blocks/src/Plugin/Block/GHIBlockBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
745745
$form['label']['#access'] = FALSE;
746746
$form['label']['#required'] = FALSE;
747747
$form['label_display']['#access'] = FALSE;
748-
$form['context_mapping']['#access'] = FALSE;
748+
$form['context_mapping']['#access'] = $form_state->get('current_subform') == self::CONTEXTS_FORM_KEY && !$this->isConfigurationPreview();
749749

750750
$settings_form = &$form['container'];
751751

html/modules/custom/ghi_content/ghi_content.module

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function ghi_content_form_ghi_subpages_admin_views_form_alter(array &$form, Form
189189
/**
190190
* Implements hook_form_FORM_ID_alter().
191191
*
192-
* Used to disable fields that automatically populated.
192+
* Used to disable fields that are automatically populated.
193193
*/
194194
function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateInterface $form_state) {
195195
/** @var \Drupal\ghi_content\ContentManager\ArticleManager $article_manager */
@@ -201,7 +201,7 @@ function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateIn
201201
/**
202202
* Implements hook_form_FORM_ID_alter().
203203
*
204-
* Used to disable fields that automatically populated.
204+
* Used to disable fields that are automatically populated.
205205
*/
206206
function ghi_content_form_node_document_edit_form_alter(array &$form, FormStateInterface $form_state) {
207207
/** @var \Drupal\ghi_content\ContentManager\DocumentManager $article_manager */

html/modules/custom/ghi_content/src/ContentManager/ArticleManager.php

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ public function updateNodeFromRemote(NodeInterface $node, $dry_run = FALSE, $res
216216

217217
if (!$dry_run) {
218218
$this->importManager->layoutManagerDiscardChanges($node, NULL);
219+
$node->setSyncing(TRUE);
219220
}
220221
}
221222

html/modules/custom/ghi_content/src/ContentManager/BaseContentManager.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ public function nodeEditFormAlter(array &$form, FormStateInterface $form_state)
633633
$this->messenger->addWarning($this->t('Some of the fields in this form are disabled because their content is automatically synced from the remote source.'));
634634
}
635635

636-
$migration_id = $this->getMigration($node)->id();
637-
$loaded_migration = Migration::load($migration_id);
638-
$destination = $loaded_migration->get('destination');
636+
$migration = $this->getMigration($node);
637+
$loaded_migration = $migration ? Migration::load($migration->id()) : NULL;
638+
$destination = $loaded_migration?->get('destination') ?? NULL;
639639
$disabled_field_text = $this->t('This field is disabled because it is automatically populated from the remote source.');
640640

641-
$field_keys = array_merge($destination['overwrite_properties'], ['field_image']);
641+
$field_keys = array_merge($destination ? $destination['overwrite_properties'] : [], ['field_image']);
642642
foreach ($field_keys as $field_key) {
643643
if (empty($form[$field_key])) {
644644
continue;

html/modules/custom/ghi_content/src/Controller/ContentBaseListController.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ protected function runMigration($redirect, array $tags = NULL) {
7373
$this->messenger()->addWarning($this->t('The import is currently running. Please try again later.'));
7474
return new RedirectResponse($redirect);
7575
}
76+
$options = [
77+
'update' => 0,
78+
];
7679
if ($tags !== NULL) {
7780
$options['configuration'] = ['source_tags' => $tags];
7881
}
79-
$executable = new MigrateBatchExecutable($migration, new MigrateMessage());
82+
$executable = new MigrateBatchExecutable($migration, new MigrateMessage(), $options);
8083
$executable->batchImport();
8184
batch_process($redirect);
8285
$batch = batch_get();

html/modules/custom/ghi_content/src/EventSubscriber/PostRowSaveEventSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function onMigratePostRowSave(MigratePostRowSaveEvent $event) {
7878
if (!in_array($event->getMigration()->id(), $migration_ids)) {
7979
return;
8080
}
81-
if (!$event->getRow()->needsUpdate()) {
81+
if (!$event->getRow()->changed()) {
8282
return;
8383
}
8484
$ids = $event->getDestinationIdValues();

html/modules/custom/ghi_content/src/Plugin/Block/Paragraph.php

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ public function getArticle() {
429429
}
430430
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceManager $remote_source_manager */
431431
$remote_source_manager = \Drupal::service('plugin.manager.remote_source');
432+
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceInterface $remote_source */
432433
$remote_source = $remote_source_manager->createInstance($remote_source_key);
433434
$article_id = $conf['article_select']['article']['article_id'] ?? NULL;
434435
if (!$remote_source || !$article_id) {

html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function query($payload) {
230230
];
231231

232232
// See if we have a cached version already for this request.
233-
$cache_key = $this->getCacheKey(['url' => $this->getRemoteEndpointUrl()] + $post_args);
233+
$cache_key = $this->getCacheKey(['url' => $this->getRemoteEndpointUrl()] + ['body' => $post_args['body']]);
234234
if (!$this->disableCache && $response = $this->cache($cache_key)) {
235235
// If we have a cached version, use that.
236236
return $response;

html/modules/custom/ghi_enforce_alias_pattern/src/EnforceAliasPatternManager.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Drupal\ghi_enforce_alias_pattern;
44

55
use Drupal\Component\Utility\NestedArray;
6+
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
67
use Drupal\Core\Entity\ContentEntityFormInterface;
78
use Drupal\Core\Entity\EntityTypeManagerInterface;
89
use Drupal\Core\Form\FormStateInterface;
@@ -15,6 +16,7 @@
1516
class EnforceAliasPatternManager {
1617

1718
use StringTranslationTrait;
19+
use DependencySerializationTrait;
1820

1921
/**
2022
* The pathauto generator service.

html/modules/custom/ghi_plans/src/Helpers/PlanEntityHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static function getPlanEntityObjects($plan_data) {
9090
*/
9191
public static function getPlanEntity($entity_id, $version_argument = 'current') {
9292
/** @var \Drupal\hpc_api\Query\EndpointQuery $query */
93-
$query = \Drupal::service('hpc_api.endpoint_query');
93+
$query = clone \Drupal::service('hpc_api.endpoint_query');
9494
$query->setArguments([
9595
'endpoint' => 'planEntity/' . $entity_id,
9696
'api_version' => 'v2',

html/modules/custom/ghi_plans/src/Plugin/EndpointQuery/PlanProjectFundingQuery.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* id = "plan_project_funding_query",
1515
* label = @Translation("Plan funding summary query"),
1616
* endpoint = {
17-
* "public" = "fts/project/plan?planid={plan_id}&groupBy=project",
18-
* "version" = "v1"
17+
* "public" = "fts/project/plan",
18+
* "version" = "v1",
19+
* "query" = {
20+
* "planid" = "{plan_id}",
21+
* "groupBy" = "project"
22+
* }
1923
* }
2024
* )
2125
*/

html/modules/custom/ghi_subpages/src/LayoutBuilder/LogframeRebuildForm.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,8 @@ protected function successfulAjaxSubmit(array $form, FormStateInterface $form_st
196196
$response->addCommand(new RedirectCommand($entity_url->toString()));
197197
}
198198
else {
199-
/** @var \Drupal\layout_builder_ipe\Controller\EntityEditController $entity_edit_controller */
200-
$entity_edit_controller = $this->controllerResolver->getControllerFromDefinition(EntityEditController::class);
201-
$response = $entity_edit_controller->edit($form_state->get('section_storage'));
199+
$callable = $this->controllerResolver->getControllerFromDefinition(EntityEditController::class . '::edit');
200+
$response = $callable($form_state->get('section_storage'));
202201
$response->addCommand(new CloseDialogCommand('#layout-builder-modal'));
203202
}
204203
return $response;

html/modules/custom/ghi_templates/src/LayoutBuilder/ImportPageConfigForm.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,8 @@ protected function successfulAjaxSubmit(array $form, FormStateInterface $form_st
314314
$response->addCommand(new RedirectCommand($entity_url->toString()));
315315
}
316316
else {
317-
/** @var \Drupal\layout_builder_ipe\Controller\EntityEditController $entity_edit_controller */
318-
$entity_edit_controller = $this->controllerResolver->getControllerFromDefinition(EntityEditController::class);
319-
$response = $entity_edit_controller->edit($form_state->get('section_storage'));
317+
$callable = $this->controllerResolver->getControllerFromDefinition(EntityEditController::class . '::edit');
318+
$response = $callable($form_state->get('section_storage'));
320319
$response->addCommand(new CloseDialogCommand('#layout-builder-modal'));
321320
}
322321
return $response;

html/modules/custom/hpc_api/src/Query/EndpointQueryBase.php

+10-8
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,19 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
7272
$endpoint_query_args = $plugin_definition['endpoint']['query'] ?? [];
7373

7474
$this->isAutenticatedEndpoint = $endpoint_authenticated && $this->user->isAuthenticated() && $this->getHidAccessToken();
75+
$endpoint_url = $this->isAutenticatedEndpoint ? $endpoint_authenticated : $endpoint_public;
76+
$auth_method = EndpointQuery::AUTH_METHOD_BASIC;
7577
if ($endpoint_api_key) {
76-
$this->endpointQuery->setAuthMethod(EndpointQuery::AUTH_METHOD_API_KEY);
77-
$this->endpointQuery->setEndpoint($endpoint_api_key);
78-
}
79-
else {
80-
$this->endpointQuery->setAuthMethod(EndpointQuery::AUTH_METHOD_BASIC);
81-
$this->endpointQuery->setEndpoint($this->isAutenticatedEndpoint ? $endpoint_authenticated : $endpoint_public);
78+
$auth_method = EndpointQuery::AUTH_METHOD_API_KEY;
79+
$endpoint_url = $endpoint_api_key;
8280
}
8381

84-
$this->endpointQuery->setEndpointVersion($endpoint_version);
85-
$this->endpointQuery->setEndpointArguments($endpoint_query_args);
82+
$this->endpointQuery->setArguments([
83+
'api_version' => $endpoint_version,
84+
'endpoint' => $endpoint_url,
85+
'query_args' => $endpoint_query_args,
86+
'auth_method' => $auth_method,
87+
]);
8688
}
8789

8890
/**

html/sites/default/settings.docksal.php

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
$config['system.performance']['css']['preprocess'] = FALSE;
8181
$config['system.performance']['js']['preprocess'] = FALSE;
8282

83+
// Memcache.
84+
$settings['memcache']['servers'] = ['memcached:11211' => 'default'];
85+
$settings['memcache']['bins'] = ['default' => 'default'];
86+
$settings['memcache']['key_prefix'] = '';
87+
$settings['cache']['default'] = 'cache.backend.memcache';
88+
8389
// Reverse proxy configuration (Docksal vhost-proxy)
8490
if (PHP_SAPI !== 'cli') {
8591
$settings['reverse_proxy'] = TRUE;

0 commit comments

Comments
 (0)