47582b3e3c improved
template selection, but has introduced a regression. Specifically, it applies to contorllers that are
created by making a direct subclass of Page_Controller (a pattern used in a few modules to make a page
that looks like a CMS page but doesn't appear in the sitetree). Previously Page.ss would be used as a
template, because when Page_Controller was interrogated in the template stack, the strtok(Page_Controller,_)
was called before looking up the template.
The code was refactored to use SSViewer::get_templates_by_class(), which doesn't do this. This function
is used by LeftAndMain as well, so rather than re-add the strtok() call, which might cause unintended
side-effects, I've instead just have it ignore _controller in a classname. Strictly speaking, this is
an API change, but as long as people have followed page type class naming conventions, it will still
work in the relevant cases.
The motivation for this was to allow module developers to change what parser is used to parse SilverStripe templates.
This change enables people to compile their own version of the SilverStripe template parser and use it without modifying core files.
FIX: Ensure SSViewer::hasTemplate() is aware of themes.
To do this, RequestHandler::definingClassForAction() has been created, splitting out the code that looks up the class that defines a given action into its own method. This is then overridden in Controller to look at templates.
Since we can't influence the setting of configuration values,
we also can't set/unset the 'custom_theme' value based on which
theme is set. This means the 'custom_theme' value goes stale,
and we can't rely on it e.g. in FilesystemPublisher.
The 'theme_enabled' toggle is a cleaner solution to the same problem,
since the 'custom_theme' was really just a way to remember the original
theme, while still disabling it. The toggle makes this more explicit,
but also requires users of the 'theme' setting to check for it.
This means that you dont have to worry about casting it
as HTMLText again when using the result in a template or other context
However in some situations code might be assuming it can
check with is_string, in which case you now need to use instanceof HTMLText
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit. This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
Use third party tools like XHProf instead.
Removed defunct or unnecessary debug GET parameters:
debug_profile, debug_memory, profile_trace, debug_javascript, debug_behaviour