-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Compiler modules do not work when ProcessWire namespace is present #882
Comments
I guess this issue relates to the the template setting "Use Compiled File?" which defaults to "Auto (compile when file has no namespace)". I see now that the description for this field does mention FileCompiler modules, but I think this setup is not ideal. The "Auto" setting is probably unwanted when users have a FileCompiler module installed and it doesn't seem reasonable to expect these users to go through the settings for every existing template to change this, and to remember to change it for every new template they add. Also, setting "Auto (compile when file has no namespace)" as the default seems to treat the FileCompiler as if it is only about adding the ProcessWire namespace, when the blog post that introduced the FileCompiler says that it is intended to be about more than just the namespace:
Because FileCompiler modules have nothing to do with the PW namespace it doesn't seem right that they are subject to a default setting that leaves them ineffective when the PW namespace is present. Could the template compilation settings distinguish between the core FileCompiler use which is about the namespace, and FileCompiler modules? So maybe if one or more FileCompiler modules are installed there are additional options to disable the FileCompiler modules for that template, but FileCompiler modules will compile templates (and files included from them) by default. As you may have guessed, I'm developing a FileCompiler module but having the module inactive on every template by default (I think most users are adding the namespace to their template files by now) makes the idea a lot less workable. |
I'm still struggling with this issue. A couple of additional notes: 1. The fact that The 2. The PhpDoc comments for
To me that reads as if templates will be compiled (and the compiled file used for template rendering) if |
Short description of the issue
ProcessWire v3.0 introduced a new type of module: File Compiler modules that extend the FileCompilerModule class. It also included a new module FileCompilerTags.
This issue is about the fact that File Compiler modules do not work when template files include the ProcessWire namespace.
To illustrate with FileCompilerTags...
basic-page.php without namespace:
Result:
basic-page.php with namespace:
Result:
The introductory blog post, the comments in
FileCompilerModule.php
, and the comments inFileCompilerTags.module
do not mention that it is necessary for the ProcessWire namespace to be absent. And IMO it shouldn't be necessary - a person might include the ProcessWire namespace to get code completion and documentation in their IDE and this shouldn't impact on whether they can use File Compiler modules.Setup/Environment
The text was updated successfully, but these errors were encountered: