Files
summercms/.planning/todos/pending/scaffold-admin-controller-incomplete.md
Jakub Zych 3f9d3b4f11 docs: sync todos with g15office and map phases to milestone tasks
Tag the 17 open todos with their g15office task IDs, close 7 todos that
are already done or promoted to Phase 16.3, and record the sync rules
and the phase-to-task map in .planning/G15OFFICE.md.
2026-10-11 02:01:50 +02:00

2.0 KiB

title, date, priority, area, g15office
title date priority area g15office
make:admin-controller output does not boot and names the model after the controller 2026-09-30 medium summercms.go internal/build evdzmic4

summer make:admin-controller acme.blog Posts writes a controller and YAML that compile but are not a working admin screen:

  • ModelName() returns Posts and both YAML files say modelClass: Posts, the controller name, where WinterCMS uses the model (Post). fields.yaml and columns.yaml go under models/posts/, the controller's snake name, not the model's.
  • The controller implements only pact.AdminController. Without pact.AdminRecordSource (NewRecord) the admin API answers every record route with a capability error, and without pact.AdminPermissioned any signed-in administrator can open it (cabana.Allows treats an empty list as "any authenticated principal").
  • Neither make:plugin nor make:admin-controller gives the plugin an AdminFS (pact.AdminAssets), so once the admin is enabled cabana.Activate stops the start-up with "plugin acme.blog has admin controllers but no AdminFS".
  • config_list.yaml offers only create; adding delete also needs showCheckboxes: true, which cabana enforces.

Found while writing docs/setup/porting-a-plugin.md (Phase 11.1 plan 05). The walkthrough fixes each point by hand and the page lists them under "What the scaffolder leaves to you".

Suggested fix: give make:admin-controller a model argument or flag (defaulting to the singular of the controller name), write modelClass and the model's YAML directory from it, generate NewRecord and a RequiredPermissions stub with <vendor>.<plugin>.access_<controller>, and have make:plugin embed controllers/*/*.yaml models/*/*.yaml and implement AdminFS (with a harmless empty tree until the first controller exists). Update docs/console/scaffolding.md and the porting page in the same change. internal/build is outside the docs phase boundary, so it is not changed in Phase 11.1.