Skip to content

Module Wire View Path #261

@mrigsby

Description

@mrigsby

I think I found an issue. It seems this is prepending wire/ to the view path and not taking into account if the wire is in a module.

if ( left( paths.normalizedPath, 6 ) != "wires/" ) {
paths.normalizedPath = "wires/" & paths.normalizedPath;
}

For instance, I have a wire editUserAccount in the userManagement module and use wire( "editUserAccount@userManagement" ) and cbwire throws a file read error

cbwire is trying to load the view from /wires/modules_app/userManagement/wires/editUserAccount.cfm instead of /modules_app/userManagement/wires/editUserAccount.cfm. If I comment out line 194 if works fine.

At the moment I am thinking we could change this line

local.normalizedPath = variables._renderService.normalizeViewPath( arguments.viewPath );

to:

local.normalizedPath = variables._renderService.normalizeViewPath( arguments.viewPath, variables._path );

and update the _renderService.normalizeViewPath() function to:
normalizeViewPath( required viewPath, required wirePath )
and check for the @ in wirePath to determine if we should skip prepending the /wire to the view path

@grantcopley Any thoughts on a better way? If you are good with that change I can make the change and double check the tests (and add any that make sense) then submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions