Skip to main content
Topic: Class '\\Themes\\default\\Theme' not found (Read 4770 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Class '\\Themes\\default\\Theme' not found

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.

Re: Class '\\Themes\\default\\Theme' not found

Reply #1

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

Just now whipped it up, untested.

Re: Class '\\Themes\\default\\Theme' not found

Reply #2

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';
Last Edit: November 27, 2016, 03:58:24 am by ahrasis

Re: Class '\\Themes\\default\\Theme' not found

Reply #3

@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.
Bugs creator.
Features destroyer.
Template killer.