ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: ahrasis on November 26, 2016, 11:39:44 pm

Title: Class '\\Themes\\default\\Theme' not found
Post by: ahrasis on November 26, 2016, 11:39:44 pm
I am testing to browse ElkArte 1.1 Beta 3 with multitenancy addon (previously named mesfa) in local browser via local ip address. It works using 1.0 branch but not in 1.1 branch. Also to note - the other domains are also accessing the forum fine (currently enabled) on:
http://alfateh.pi3kum.com/index.php
http://elkarte.ahrasis.com/index.php
http://alfateh.pi3kum.com/index.php

The browser shows:
QuoteThe 192.168.xxx.xxx page isn’t working
192.168.xxx.xxx is currently unable to handle this request.
HTTP ERROR 500
The error.log logged this:
Quote[fcgid:warn] [pid 10885] [client 192.168.xxx.xxx:57618] mod_fcgid: stderr: PHP Fatal error:  Class '\\Themes\\default\\Theme' not found in /var/www/clients/client2/web27/web/sources/Load.php on line 1371
The said part is only about this code:
Code: [Select]
	// Check if there is a Theme file
if ($id_theme != 1 && !empty($settings['theme_dir']) && file_exists($settings['theme_dir'] . '/Theme.php'))
{
require_once($settings['theme_dir'] . '/Theme.php');

$class = '\\Themes\\' . basename($settings['theme_dir']) . '\\Theme';

$theme = new $class($id_theme);

$context['theme_instance'] = $theme;
}
else
{
$context['theme_instance'] = $context['default_theme_instance'];
}
I am trying to figure out about this and how to fix it, if possible.
Title: Re: Class '\\Themes\\default\\Theme' not found
Post by: live627 on November 27, 2016, 01:33:25 am
Code: [Select]
		$class = '\\Themes\\' . basename(ucfirst($settings['theme_dir']) . 'Theme\\Theme';

Just now whipped it up, untested.
Title: Re: Class '\\Themes\\default\\Theme' not found
Post by: ahrasis on November 27, 2016, 03:52:21 am
Tested it with no luck:
Quotemod_fcgid: stderr: PHP Parse error:  syntax error, unexpected ';' in /var/www/clients/client2/web27/web/sources/Load.php on line 1369

Edited: Missing one closing bracket. Now it works.
Code: [Select]
		$class = '\\Themes\\' . basename(ucfirst($settings['theme_dir'])) . 'Theme\\Theme';
Title: Re: Class '\\Themes\\default\\Theme' not found
Post by: emanuele on January 28, 2017, 04:33:54 pm
@Joshua Dickerson quick question:
https://github.com/elkarte/Elkarte/blob/development/sources/Load.php#L1373
do you remember why the default theme is initialized before trying to see if another theme should be initialized?
Giving a quick look at the code it doesn't seem to do anything particular... It seems.