Skip to content

Commit

Permalink
Merge pull request #16610 from craftcms/bugfix/settings-routes-reorde…
Browse files Browse the repository at this point in the history
…ring

Bugfix/settings routes reordering
  • Loading branch information
brandonkelly authored Jan 31, 2025
2 parents 19aacc2 + cdf395a commit f1aeb2a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where section-specific GraphQL queries (`<sectionHandle>Entries`) weren’t available if a Matrix or CKEditor field existed with the same handle as the section.
- Fixed an error that could occur after reordering routes. ([#16610](https://github.com/craftcms/cms/pull/16610))

## 5.6.4 - 2025-01-30

Expand Down
3 changes: 3 additions & 0 deletions src/services/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public function getProjectConfigRoutes(): array
$this->_projectConfigRoutes = [];

foreach ($routes as $route) {
if (!array_key_exists('siteUid', $route)) {
continue;
}
$key = sprintf('pattern:%s', $route['uriPattern']);
if (
!isset($this->_projectConfigRoutes[$key]) &&
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/routes/dist/routes.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/routes/dist/routes.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/routes/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import './routes.scss';
},

getRoutes: function () {
return this.$container.children();
return this.$container.children('.route');
},

updateRouteOrder: function () {
Expand Down
3 changes: 3 additions & 0 deletions src/web/twig/variables/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function getProjectConfigRoutes(): array
$results = Craft::$app->getProjectConfig()->get(ProjectConfig::PATH_ROUTES) ?? [];

foreach ($results as $routeUid => $route) {
if (!array_key_exists('siteUid', $route)) {
continue;
}
$uriDisplayHtml = '';

if (!empty($route['uriParts'])) {
Expand Down

0 comments on commit f1aeb2a

Please sign in to comment.