Skip to content

wheels generate admin generates invalid controller and broken view templates #2488

@zainforbjs

Description

@zainforbjs

Describe the bug
Running the wheels generate admin command generates multiple issues in the produced admin interface.

The generated files contain:

  • Incorrect controller inheritance
  • Missing <cfoutput> blocks in views
  • Invalid route names such as admin~users.
  • Broken template structure in generated form partials

As a result, the generated admin interface is not fully functional out-of-the-box.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command:
    wheels generate admin User
    
  2. Start the development server:
    wheels stop && wheels start
    
  3. Open the generated controller and views
  4. Observe invalid controller inheritance, route usage, and malformed view templates

Issues observed

1. Incorrect controller inheritance

Generated controller:

component extends="Controller" {

Expected:

component extends="app.controllers.Controller" {

2. Invalid route names

Generated code uses routes such as:

redirectTo(route="admin~users");

and:

redirectTo(route="admin~user", key=user.key());

These route names are invalid or unresolved in generated applications.

3. Missing <cfoutput> in generated views

Generated view templates contain Wheels helper functions but are missing surrounding <cfoutput> tags.
Example generated view:

#errorMessagesFor(objectName="user")#
#startFormTag(route=local.formRoute, method=local.formMethod, key=local.formKey)#
#textField(objectName="user", property="lastname")#

Expected:

<cfoutput>
#errorMessagesFor(objectName="user")#
#startFormTag(route=local.formRoute, method=local.formMethod, key=local.formKey)#
#textField(objectName="user", property="lastname")#
</cfoutput>

Without <cfoutput>, helper functions are rendered as plain text instead of executing.

Expected behavior
The admin generator should:

  • Generate valid controller inheritance
  • Use valid route names
  • Wrap helper-based templates in
  • Generate clean, non-duplicated form partials
  • Produce a functional admin interface out-of-the-box

Desktop

  • OS: Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions