Skip to content

Commit 3a63cb3

Browse files
Merge pull request #48 from sachbearbeiter/main
Fixes for issues #46 and #47
2 parents a64fa7d + ea92147 commit 3a63cb3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

config/api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
return function () {
1616
return [
1717
[
18-
'pattern' => 'listings/(:alpha)/(:all)',
18+
'pattern' => 'listings/(:all)/(:all)',
1919
'method' => 'GET',
2020
'action' => function ($language_code, $path) {
2121
$content = [];

config/methods.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,10 @@
8989
// This method is provided only for compatibility reasons,
9090
// to help the users of older plugin versions
9191
'toNavigationStructure' => function ($field) {
92-
// Refresh items to get the current multilang URL and page titles
93-
// and set item values needed for markup generation
94-
$items=$field->toNavigationArray();
9592
// Use anonymous recursive function to process child items
9693
$process_item = function($key, $item) use (&$process_item) {
9794
// Preserve any original 'id' value as 'link_id'
98-
$items['link_id']=$item['id'] ?? '';
95+
$item['link_id']=$item['id'] ?? '';
9996
// Overwrite the 'id' (slug) value in link items,
10097
// because the Structure class also uses it as index
10198
$item['id']=$key;
@@ -107,6 +104,9 @@
107104
}
108105
return $item;
109106
};
107+
// Refresh items to get the current multilang URL and page titles
108+
// and set item values needed for markup generation
109+
$items=$field->toNavigationArray();
110110
if (is_array($items) && $items) {
111111
foreach ($items as $key => $item) {
112112
$items[$key]=$process_item($key, $item);

0 commit comments

Comments
 (0)