Skip to content

Commit fe6d332

Browse files
merge branch v2 (release 2.0.0-beta.51)
2 parents 3e88122 + c031e75 commit fe6d332

7 files changed

Lines changed: 23 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Changelog
22

3-
## [v2.0.0-beta.50](https://github.com/marcantondahmen/automad/commit/395d62584987b5fb149a9b322b8206b708f57818)
3+
## [v2.0.0-beta.51](https://github.com/marcantondahmen/automad/commit/7dcd32525c6eb38b2f0f9c83a5536077d86ce279)
44

5-
Sun, 19 Jul 2026 12:24:34 +0200
5+
Sun, 19 Jul 2026 15:53:13 +0200
6+
7+
### Bugfixes
8+
9+
- fix search and replace in shared data ([ce9789472](https://github.com/marcantondahmen/automad/commit/ce97894725bf17a46586f45e2f1f9b1e43198057))
10+
11+
## [v2.0.0-beta.50](https://github.com/marcantondahmen/automad/commit/3e88122efeb22c8147912f8457ba61ee1e45afb6)
12+
13+
Sun, 19 Jul 2026 14:57:18 +0200
614

715
### Bugfixes
816

automad/src/server/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* @license See LICENSE.md for license information
5757
*/
5858
class App {
59-
const VERSION = '2.0.0-beta.50';
59+
const VERSION = '2.0.0-beta.51';
6060

6161
/**
6262
* Required PHP version.

automad/src/server/Models/Search/FileResults.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
* @license See LICENSE.md for license information
4646
*/
4747
class FileResults {
48+
const KEY_SHARED = '@shared';
49+
4850
/**
4951
* The the count of results in a file.
5052
*/
@@ -78,8 +80,8 @@ class FileResults {
7880
*/
7981
public function __construct(array $fieldResultsArray, ?string $path, ?string $url) {
8082
$this->fieldResultsArray = $fieldResultsArray;
81-
$this->path = $path;
82-
$this->url = $url;
83+
$this->path = $path ?? self::KEY_SHARED;
84+
$this->url = $url ?? '';
8385
$this->count = 0;
8486

8587
foreach ($fieldResultsArray as $fieldResults) {

automad/src/server/Models/Search/Replacement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ public function replaceInFiles(array $fileFieldsArray): bool {
174174
}
175175

176176
foreach ($fileFieldsArray as $FileFields) {
177-
$DataStore = new DataStore($FileFields->path);
177+
$path = $FileFields->path === FileResults::KEY_SHARED ? null : $FileFields->path;
178+
$DataStore = new DataStore($path);
178179

179180
$draft = $DataStore->getState(PublicationState::DRAFT) ?? array();
180181
$draft = $this->replaceInData($draft, $FileFields->fields);

automad/tests/main/src/Models/Search/SearchTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public static function dataForTestSearchPerFileIsSame() {
114114
]
115115
}
116116
],
117-
"path": null,
118-
"url": null
117+
"path": "@shared",
118+
"url": ""
119119
}
120120
]
121121
JSON
@@ -195,8 +195,8 @@ public static function dataForTestSearchPerFileIsSame() {
195195
"matches": ["test"]
196196
}
197197
],
198-
"path": null,
199-
"url": null
198+
"path": "@shared",
199+
"url": ""
200200
},
201201
{
202202
"count": 4,

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "automad",
3-
"version": "2.0.0-beta.50",
3+
"version": "2.0.0-beta.51",
44
"description": "Automad",
55
"author": "Marc Anton Dahmen",
66
"private": true,

0 commit comments

Comments
 (0)