Skip to content

Commit f9e4bdc

Browse files
committed
Merge remote-tracking branch 'origin/2.4' into 2.5
2 parents eaa59d3 + 1a1c2a5 commit f9e4bdc

File tree

6 files changed

+80
-21
lines changed

6 files changed

+80
-21
lines changed

composer.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,25 @@
1717
"prefer-stable": true,
1818
"minimum-stability": "dev",
1919
"require": {
20-
"php": "~8.3.0 || ~8.4.0 ",
20+
"php": "~8.4.0 || ~8.5.0 ",
2121
"nesbot/carbon": "^3.8.4",
22-
"pimcore/pimcore": "^12.3",
23-
"pimcore/static-resolver-bundle": "^3.0",
22+
"pimcore/pimcore": "^2026.1",
23+
"pimcore/static-resolver-bundle": "^2026.1",
2424
"pimcore/opensearch-client": "^2.0",
2525
"pimcore/elasticsearch-client": "^2.0",
2626
"doctrine/orm": "^3.0",
27-
"symfony/scheduler": "^6.4 || ^7.2"
27+
"symfony/scheduler": "^7.2"
2828
},
2929
"require-dev": {
3030
"roave/security-advisories": "dev-latest",
31-
"codeception/codeception": "^5.3.2",
32-
"codeception/stub": "^4.3.0",
33-
"codeception/phpunit-wrapper": "^9",
34-
"codeception/module-asserts": "^2",
35-
"codeception/module-symfony": "^3.1.1",
31+
"codeception/codeception": "^5.3.4",
32+
"codeception/module-asserts": "^3.0",
33+
"codeception/module-symfony": "^3.7.1",
3634
"phpstan/phpstan": "1.12.15",
3735
"phpstan/phpstan-symfony": "^1.2.20",
38-
"phpunit/phpunit": "^10.5.63",
36+
"phpunit/phpunit": "^10.5",
3937
"nyholm/psr7": "^1",
40-
"symfony/phpunit-bridge": "^6",
38+
"symfony/phpunit-bridge": "^7",
4139
"fakerphp/faker": "^1.23",
4240
"friendsofphp/php-cs-fixer": "^3.4"
4341
},
@@ -53,7 +51,7 @@
5351
},
5452
"extra": {
5553
"branch-alias": {
56-
"dev-2.x": "2.4.x-dev"
54+
"dev-2026.x": "2026.1.x-dev"
5755
},
5856
"pimcore": {
5957
"bundles": [

doc/01_Installation/02_Upgrade.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Following steps are necessary during updating to newer versions.
44

5+
## Upgrade to 2026.1.0
6+
- Added support to `PHP` `8.5`.
7+
- Removed support to `PHP` `8.3` and Symfony `v6`.
8+
-
59
## Upgrade to 2.2.0
610
- [Indexing] Added `id` column as new primary key to `generic_data_index_queue`. Please make sure to execute migrations.
711
- [Searching] Added `trackTotalHits` parameter to `DefaultSearchService` and `SearchExecutionService`. The default value is true, which means that total hits will always be computed accurately, even if they exceed the search engines threshold for accurate hit calculation. Change this parameter to `null`, to use the default threshold, pass an integer value to set a specific one.

doc/02_Configuration/05_Elasticsearch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pimcore_elasticsearch_client:
1818
hosts: ['elastic:9200']
1919
username: 'elastic'
2020
password: 'somethingsecret'
21-
logger_channel: 'pimcore.elasicsearch'
21+
logger_channel: 'pimcore.elasticsearch'
2222

2323
# Define the client to be used by your bundle (default client_type is 'openSearch')
2424
pimcore_generic_data_index:
@@ -32,4 +32,4 @@ For the further configuration of the client, please refer to the [Pimcore Elasti
3232
3333
## Important Elasticsearch Configuration
3434
35-
Elasticsearch automatically creates indices on storing data if the index does not yet exist. This will cause issues with wrong indices and missing aliases. To overcome this issue, you need to disable that feature with the configuration `action.auto_create_index=false`.
35+
Elasticsearch automatically creates indices on storing data if the index does not yet exist. This will cause issues with wrong indices and missing aliases. To overcome this issue, you need to disable that feature with the configuration `action.auto_create_index=false`.

doc/04_Searching_For_Data_In_Index/09_Pimcore_Query_Language/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pimcore Query Language
1+
# Pimcore Query Language (PQL)
22

33
Pimcore Query Language (PQL) is a query language that allows you to search for data in the Pimcore Generic Data Index. It is a simple and powerful query language that allows you to search for data using a wide range of search criteria.
44

src/SearchIndexAdapter/DefaultSearch/DataObject/FieldDefinitionAdapter/TimeAdapter.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,13 @@ public function getIndexMapping(): array
2727
'format' => 'strict_hour_minute',
2828
];
2929
}
30+
31+
public function normalize(mixed $value): mixed
32+
{
33+
if ($value === '') {
34+
return null;
35+
}
36+
37+
return parent::normalize($value);
38+
}
3039
}

src/SearchIndexAdapter/DefaultSearch/PathService.php

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ private function updatePath(string $indexName, string $currentPath, string $newP
124124
'params' => [
125125
'currentPath' => $currentPath . '/',
126126
'newPath' => $newPath . '/',
127-
'changePathLevel' => count($pathLevels) - 1,
128-
'newPathLevelName' => end($pathLevels),
129127
],
130128
],
131129

@@ -154,15 +152,65 @@ private function getScriptSource(): string
154152
String subFullPath = ctx._source.system_fields.fullPath.substring(params.currentPath.length());
155153
ctx._source.system_fields.fullPath = params.newPath + subFullPath;
156154
157-
for (int i = 0; i < ctx._source.system_fields.pathLevels.length; i++) {
158-
155+
if(ctx._source.system_fields.thumbnail != null &&
156+
ctx._source.system_fields.thumbnail.length() >= params.currentPath.length()) {
157+
String thumbnailPrefix = ctx._source.system_fields.thumbnail.substring(
158+
0,
159+
params.currentPath.length()
160+
);
161+
if(thumbnailPrefix == params.currentPath) {
162+
String thumbnailSubPath = ctx._source.system_fields.thumbnail.substring(
163+
params.currentPath.length()
164+
);
165+
ctx._source.system_fields.thumbnail = params.newPath + thumbnailSubPath;
166+
}
167+
}
159168
160-
if(ctx._source.system_fields.pathLevels[i].level == params.changePathLevel) {
169+
if(ctx._source.containsKey("custom_fields") &&
170+
ctx._source.custom_fields.containsKey("PortalEngineBundle") &&
171+
ctx._source.custom_fields.PortalEngineBundle.containsKey("system_fields") &&
172+
ctx._source.custom_fields.PortalEngineBundle.system_fields.containsKey("thumbnail")) {
173+
def customFields = ctx._source.custom_fields.PortalEngineBundle.system_fields;
174+
if(customFields.thumbnail != null && customFields.thumbnail instanceof String) {
175+
String thumb = customFields.thumbnail;
176+
String prefix = "";
177+
int pathStart = 0;
178+
179+
if(thumb.startsWith("/cache-buster-")) {
180+
int slashPos = thumb.indexOf("/", 1);
181+
if(slashPos > 0) {
182+
prefix = thumb.substring(0, slashPos);
183+
pathStart = slashPos;
184+
}
185+
}
186+
187+
String encodedCurrentPath = params.currentPath.replace(" ", "%20");
188+
String thumbPath = thumb.substring(pathStart);
189+
190+
if(thumbPath.startsWith(encodedCurrentPath) || thumbPath.startsWith(params.currentPath)) {
191+
String matchedPath = thumbPath.startsWith(encodedCurrentPath) ?
192+
encodedCurrentPath : params.currentPath;
193+
String remainingPath = thumbPath.substring(matchedPath.length());
194+
String encodedNewPath = params.newPath.replace(" ", "%20");
195+
customFields.thumbnail = prefix + encodedNewPath + remainingPath;
196+
}
197+
198+
}
199+
}
161200
162-
ctx._source.system_fields.pathLevels[i].name = params.newPathLevelName;
201+
String[] newPathParts = ctx._source.system_fields.path.splitOnToken("/");
202+
203+
def newLevels = [];
204+
int levelCounter = 1;
205+
for (int i = 0; i < newPathParts.length; i++) {
206+
if(newPathParts[i].length() > 0) {
207+
newLevels.add(["level": levelCounter, "name": newPathParts[i]]);
208+
levelCounter++;
163209
}
164210
}
211+
ctx._source.system_fields.pathLevels = newLevels;
165212
}
213+
ctx._source.system_fields.modificationDate = Instant.now().toString();
166214
ctx._source.system_fields.checksum = 0';
167215
}
168216

0 commit comments

Comments
 (0)