Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/_config/routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ SilverStripe\Control\Director:
rules:
'sitemap.xml': 'App\Controllers\SitemapController'
'robots.txt': 'App\Controllers\RobotsController'
'about': AboutPage
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a new Director rule for 'about', but the repo already defines an about route in app/_config/about_routes.yml ('about//$Action/$ID/$OtherID': 'AboutController'), which will also match /about. The duplicate/conflicting rules make routing order-dependent and may prevent this rule from ever being hit. Consider updating/removing the existing about rule (or changing this rule to a different URL pattern) so there is a single source of truth for the /about route.

Suggested change
'about': AboutPage

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Director.rules expects a controller class name (or mapping to a controller action), but AboutPage is a Page/SiteTree subclass, not a Controller. As written, this route is likely to fail or never dispatch as intended. Route to an actual controller (e.g. an AboutPageController/AboutController) or implement a controller that loads/renders the AboutPage record.

Suggested change
'about': AboutPage
'about': 'App\Controllers\AboutController'

Copilot uses AI. Check for mistakes.
23 changes: 23 additions & 0 deletions app/src/AboutPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace {

use SilverStripe\CMS\Controllers\ContentController;

Comment on lines +5 to +6
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use SilverStripe\CMS\Controllers\ContentController; is unused in this file (the controller extends PageController). Remove the unused import to avoid dead code / lint warnings.

Suggested change
use SilverStripe\CMS\Controllers\ContentController;

Copilot uses AI. Check for mistakes.
class AboutPage extends Page
{
private static $table_name = 'AboutPage';

private static $db = [
'IntroText' => 'Text',
'MainContent' => 'HTMLText',
];

private static $has_one = [];
Comment on lines +15 to +16
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private static $has_one = []; is redundant here (it matches the empty definition already present on Page). Consider removing it unless you plan to add relations, to reduce noise in the class definition.

Suggested change
private static $has_one = [];

Copilot uses AI. Check for mistakes.
}

class AboutPage_Controller extends PageController
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page-type controller class is named AboutPage_Controller, but this project uses the SilverStripe 6 convention *Controller (e.g. PageController, App\Controllers\SitemapController). With CMS 6.x the _Controller suffix is not the expected naming and may not be discovered/used. Rename the class to AboutPageController (and adjust the filename if your autoloading conventions require it).

Suggested change
class AboutPage_Controller extends PageController
class AboutPageController extends PageController

Copilot uses AI. Check for mistakes.
{
private static $allowed_actions = [];
}
}
Loading