Skip to content

Relative path issue in wireIncludeFile #511

Open
@adrianbj

Description

@adrianbj

Short description of the issue

Methods in the WireFileTools class, like include use relative paths so if you use wireIncludeFile() or $files->include() from a module the file is not included because the path is something like: ./templates/fileToInclude.php

Expected behavior

It should work no matter where it's called from.

Actual behavior

You get an error triggered by https://github.com/processwire/processwire/blob/a9ec5a640ac0442d3980d2cd33770626aafc91a2/wire/core/WireFileTools.php#L730

Optional: Suggestion for a possible fix

Convert path to filename to be absolute.

Setup/Environment

  • ProcessWire version: 3.0.94

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions