Skip to content

feat: [Conflict B] Add About route#204

Open
jsirish wants to merge 1 commit intomainfrom
autopipe/issue-147
Open

feat: [Conflict B] Add About route#204
jsirish wants to merge 1 commit intomainfrom
autopipe/issue-147

Conversation

@jsirish
Copy link
Copy Markdown
Member

@jsirish jsirish commented Apr 1, 2026

Implements #147

Changes

  • Added about: AboutPage route to app/_config/routes.yml
  • Created app/src/AboutPage.php with AboutPage model and controller

Fixes #147

Copilot AI review requested due to automatic review settings April 1, 2026 22:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements issue #147 by attempting to add a fixed /about route and introducing a new CMS page type intended to back that route.

Changes:

  • Added an about rule to app/_config/routes.yml.
  • Added a new AboutPage page type (and a page controller class) in app/src/AboutPage.php.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
app/src/AboutPage.php Introduces AboutPage and a page controller class for the About section.
app/_config/routes.yml Adds a Director rule intended to route /about to the new About implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +6
use SilverStripe\CMS\Controllers\ContentController;

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.
private static $has_one = [];
}

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.
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.
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.

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.
Comment on lines +15 to +16

private static $has_one = [];
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Conflict B] Add About route

2 participants