Skip to content

Commit b18fe23

Browse files
Merge pull request #859 from City-of-Helsinki/ASU-1866-upgrade-elastic8alha6-react1.6
ASU-1866 update Elastic8 to alpha6 and bump react-asunto version
2 parents 8cab940 + 5ff2853 commit b18fe23

9 files changed

Lines changed: 698 additions & 349 deletions

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"minimum-stability": "dev",
88
"prefer-stable": true,
99
"require": {
10-
"asuntomyynti/react": "^1.5.4",
10+
"asuntomyynti/react": "^1.6.1",
1111
"composer/installers": "^2.3",
1212
"cweagans/composer-patches": "^2.0",
1313
"dinbror/blazy": "^1.8",
@@ -182,7 +182,7 @@
182182
"[D11] Skip delete when field table missing": "patches/core-skip-delete-missing-field-table.patch"
183183
},
184184
"drupal/elasticsearch_connector": {
185-
"[Local] Disable reopen parameter for ES": "patches/elasticsearch-connector-disable-reopen.patch"
185+
"Use Search API field identifier in FilterBuilder": "patches/elasticsearch_connector-filterbuilder-use-field-identifier.patch"
186186
}
187187
},
188188
"composer-patches": {
@@ -274,9 +274,9 @@
274274
"type": "package",
275275
"package": {
276276
"name": "asuntomyynti/react",
277-
"version": "1.5.4",
277+
"version": "1.6.1",
278278
"dist": {
279-
"url": "https://github.com/City-of-Helsinki/asuntomyynti-react/releases/download/v1.5.4/asuntomyynti-react-1.5.4.zip",
279+
"url": "https://github.com/City-of-Helsinki/asuntomyynti-react/releases/download/v1.6.1/asuntomyynti-react-1.6.1.zip",
280280
"type": "zip"
281281
}
282282
}

composer.lock

Lines changed: 613 additions & 321 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patches.lock.json

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"_hash": "51b14d312ccd5409f73e3d6a10dd01b7b2cfe700a0cbf9b4647d3bf1ccd72365",
2+
"_hash": "5fa7682911872f124b729ec6566e3d24c306009cccde0f3f3bec5a6706679f85",
33
"patches": {
44
"drupal/helfi_platform_config": [
55
{
66
"package": "drupal/helfi_platform_config",
7-
"description": "Catch exception during hero paragraphs allowed values update",
7+
"description": "Catch exception during hero paragraphs update",
88
"url": "patches/helfi_platform_config_hero_paragraph_fix.patch",
99
"sha256": "1162f594afac7fd9617725f64ae8f55d3da8ad8d94ed666e598699fb036f3875",
1010
"depth": 1,
@@ -21,6 +21,16 @@
2121
"extra": {
2222
"provenance": "root"
2323
}
24+
},
25+
{
26+
"package": "drupal/helfi_platform_config",
27+
"description": "Make update_9328 idempotent when status field is already deleting/purging",
28+
"url": "patches/helfi_platform_config-update-9328-idempotent.patch",
29+
"sha256": "3549d8486542cb8aa0ee57c7ba497279c7508e4aba7483e397e3fbccf459f521",
30+
"depth": 1,
31+
"extra": {
32+
"provenance": "root"
33+
}
2434
}
2535
],
2636
"drupal/config_terms": [
@@ -82,8 +92,8 @@
8292
"package": "drupal/core",
8393
"description": "[D11] Skip delete in checkOp when entity missing",
8494
"url": "patches/core-config-importer-null-entity.patch",
85-
"sha256": "b276daec9f375bba9f9f4a4c43539cfc2d0ae30e993f5db5a95c008961917336",
86-
"depth": 1,
95+
"sha256": "499e950946e506ed897bccc764cae3e0d04518008551691ed7ab2d7d345491a7",
96+
"depth": 2,
8797
"extra": {
8898
"provenance": "root"
8999
}
@@ -92,8 +102,8 @@
92102
"package": "drupal/core",
93103
"description": "[D11] Skip countFieldData when table missing",
94104
"url": "patches/core-count-field-data-missing-table.patch",
95-
"sha256": "67294a7d6862b00ea3a0a004255fdaac182fc33b4f7ea9f0a33f461e7924d00a",
96-
"depth": 1,
105+
"sha256": "9fa81cf6e82b61fcd50f52e287db8ee7b5841e739bce964c5e8ac40445321689",
106+
"depth": 2,
97107
"extra": {
98108
"provenance": "root"
99109
}
@@ -102,7 +112,19 @@
102112
"package": "drupal/core",
103113
"description": "[D11] Skip delete when field table missing",
104114
"url": "patches/core-skip-delete-missing-field-table.patch",
105-
"sha256": "b275f0ac34052fdb644eacb08643a90c372773d60483b95164bdb97ece755059",
115+
"sha256": "c63db5bfc018ae0eb34cfe708fcd95c0a6d855d58e9df2b80bc68b5b4c3b3416",
116+
"depth": 2,
117+
"extra": {
118+
"provenance": "root"
119+
}
120+
}
121+
],
122+
"drupal/elasticsearch_connector": [
123+
{
124+
"package": "drupal/elasticsearch_connector",
125+
"description": "Use Search API field identifier in FilterBuilder",
126+
"url": "patches/elasticsearch_connector-filterbuilder-use-field-identifier.patch",
127+
"sha256": "a12ef7e63b8b5c44e50f8c93ab36258dd6a8a32d4f796ba91ff9b9a33f81b905",
106128
"depth": 1,
107129
"extra": {
108130
"provenance": "root"
@@ -133,15 +155,15 @@
133155
}
134156
}
135157
],
136-
"drupal/elasticsearch_connector": [
158+
"drupal/openid_connect": [
137159
{
138-
"package": "drupal/elasticsearch_connector",
139-
"description": "[Local] Disable reopen parameter for ES",
140-
"url": "patches/elasticsearch-connector-disable-reopen.patch",
141-
"sha256": "3ae36c53076dbe007e3f6d68cb47eb2f158cb44c17f88b68f2834a56512a216c",
160+
"package": "drupal/openid_connect",
161+
"description": "Fix logout button for Drupal Test Traits",
162+
"url": "./public/modules/contrib/helfi_tunnistamo/patches/3577169.patch",
163+
"sha256": "a32f8a3a703395977de29356c46cdfa35646cd6d9ddad4c000b62abe80b4bcfe",
142164
"depth": 1,
143165
"extra": {
144-
"provenance": "root"
166+
"provenance": "dependency:drupal/openid_connect"
145167
}
146168
}
147169
]

patches/core-config-importer-null-entity.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff --git a/lib/Drupal/Core/Config/ConfigImporter.php b/lib/Drupal/Core/Config/ConfigImporter.php
2-
--- a/lib/Drupal/Core/Config/ConfigImporter.php
3-
+++ b/lib/Drupal/Core/Config/ConfigImporter.php
1+
diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php
2+
--- a/core/lib/Drupal/Core/Config/ConfigImporter.php
3+
+++ b/core/lib/Drupal/Core/Config/ConfigImporter.php
44
@@ -973,13 +973,15 @@ protected function checkOp($collection, $op, $name) {
55
}
66
break;

patches/core-count-field-data-missing-table.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git a/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
1+
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
22
index f7a3a7b4a1..2c4d1d4c7d 100644
3-
--- a/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
4-
+++ b/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
3+
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
4+
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
55
@@ -1716,6 +1716,10 @@ public function countFieldData($storage_definition, $as_bool = FALSE) {
66
else {
77
$table_name = $table_mapping->getDedicatedDataTableName($storage_definition, $is_deleted);

patches/core-skip-delete-missing-field-table.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff --git a/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
2-
--- a/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
3-
+++ b/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
1+
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
2+
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
3+
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
44
@@ -1546,14 +1546,19 @@ public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
55
$table_mapping = $this->getTableMapping();
66
if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- a/src/SearchAPI/Query/FilterBuilder.php
2+
+++ b/src/SearchAPI/Query/FilterBuilder.php
3+
@@ -89,14 +89,10 @@
4+
if ($field->getType() === 'boolean') {
5+
$condition->setValue((bool) $condition->getValue());
6+
}
7+
-
8+
- $index_field_name = $field->getPropertyPath();
9+
- // Use the property path if available.
10+
- if (!empty($index_field_name)) {
11+
- // Converting colon notation to Elasticsearch's dot notation.
12+
- $field_id = str_replace(':', '.', $index_field_name);
13+
- $condition->setField($field_id);
14+
- }
15+
+
16+
+ // Keep field identifiers as indexed field names. Replacing them with
17+
+ // property paths can produce non-existent fields in Elasticsearch.
18+
+ $field_id = $condition->getField();
19+
20+
// For text fields in facet filters, append .keyword to use the
21+
// keyword subfield for exact matching. Text fields are analyzed

patches/helfi_platform_config-update-9328-idempotent.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ diff --git a/helfi_platform_config.install b/helfi_platform_config.install
22
index 37e8a45d..b7aab1fe 100644
33
--- a/helfi_platform_config.install
44
+++ b/helfi_platform_config.install
5-
@@ -459,22 +459,38 @@ function helfi_platform_config_update_9328(): void {
5+
@@ -459,30 +459,46 @@ function helfi_platform_config_update_9328(): void {
66
// Redirect implemented EntityPublishableInterface:
77
// https://www.drupal.org/project/redirect/issues/3424962.
88
// We implemented similar field in UHF-10539.

public/modules/custom/asu_elastic/src/EventSubscriber/DistrictFieldMappingSubscriber.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,32 @@ public static function getSubscribedEvents(): array {
2525
}
2626

2727
/**
28-
* Modifies field mapping for district fields.
28+
* Modifies field mapping for district fields and URL-like fields.
2929
*
3030
* @param \Drupal\elasticsearch_connector\Event\FieldMappingEvent $event
3131
* The field mapping event.
3232
*/
3333
public function onFieldMapping(FieldMappingEvent $event): void {
3434
$field = $event->getField();
3535
$fieldId = $field->getFieldIdentifier();
36+
$fieldType = $field->getType();
3637

3738
// Force keyword mapping for district field to prevent tokenization.
3839
if ($fieldId === 'project_district') {
3940
$event->setParam(['type' => 'keyword']);
41+
return;
42+
}
43+
44+
// Force keyword mapping for URL-like fields.
45+
// In ES 8.11+, unmapped float arrays (typically 128-2048 length)
46+
// are auto-inferred as dense_vector, causing parse errors when
47+
// actual values are strings.
48+
// Explicit keyword mapping prevents this auto-mapping behavior.
49+
if (
50+
$fieldId === 'image_urls'
51+
|| in_array($fieldType, ['asu_file_url', 'asu_url', 'computed_array_string'], TRUE)
52+
) {
53+
$event->setParam(['type' => 'keyword']);
4054
}
4155
}
4256

0 commit comments

Comments
 (0)