The issue has been verified to exist in version 2.0.2 upto and
including 2.0.4
When the theme name of an Exponent installation occurs in the
pathname of the docroot for the hosting environment, a failure will
occur in finding the default modules-1 templates. This will result
in a disfunctional CMS system.
I came across the situation when I wanted to move a website I
developed to a production server. On my development server
everything was just fine (as the theme name did not occur in the
docroot filepath), on the production server however it failed.
An example situation:
Theme name: mycompanyname (not really uncommon)
Docroot on the server: /home/users/mycompanyname.com
The failing function:
public static function resolveFilePaths($type, $name, $subtype, $subname) {
The failing piece of code (in Exponent 2.0.4, starting at line
440 in file: framework/core/subsystems/expCore.php):
foreach($locations as $location) {
$checkpaths[] = $location . $typepath . $relpath2;
//if (strstr($location,DISPLAY_THEME_REAL) && strstr($relpath,"framework/modules-1")) {
if (strstr($location,DISPLAY_THEME) && strstr($relpath,"framework/modules-1")) {
$checkpaths[] = $location . str_replace("framework/modules-1", "modules", $relpath);
} else {
$checkpaths[] = $location . $relpath;
}
//eDebug($relpath);
}
//eDebug($checkpaths);
In above example situation you will end up with:
A PHP define DISPLAY_THEME with a value of "mycompanyname"
$locations being: Array(
"/home/users/mycompanyname.com/framework/modules-1/views/Default.tpl",
"/home/users/mycompanyname.com/modules/containermodule/views/Default.tpl",
"/home/users/mycompanyname.com/themes/mycompanyname/framework/modules-1/views/Default.tpl",
"/home/users/mycompanyname.com/themes/mycompanyname/modules/containermodule/views/Default.tpl",
}
Now this line will fail as ALL $locations will match
strstr($location, DISPLAY_THEME):
if (strstr($location,DISPLAY_THEME) && strstr($relpath,"framework/modules-1")) {
Please work towards a safer way to determine if the locations
need to be changed. The current solution is guaranteed to fail on
more users then just me. I will for now just rename my theme to get
this resolved, although it is not my preferred way to get it solved
for now.