Skip to main content
Topic: Bug with HomePage_0-0-1 (Read 3165 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Bug with HomePage_0-0-1

There is a bug with the Addon HomePage_0-0-1 => http://www.elkarte.net/community/index.php?topic=2846.msg19507#msg19507

By clicking the breadcrumbs of categories, the link goes to the homepage (index.php) than on the category (index.php#c). Please look auf the image "bug_home.png". Or look at my Page => http://elkarte.scaricare.de/index.php?board=5.0 and click in the breadcrumbs of "Addons Themes".
I have found aunsatisfied solution. Please look at the image "bug_home-1.png"
open root/sources/subs/Load.php
find
Code: (php) [Select]
				'url' => $scripturl . '#c' . $board_info['cat']['id'],
replaces with
Code: (php) [Select]
				'url' => $scripturl . '?action=forum#c' . $board_info['cat']['id'],

HomePage.integrate.php
Code: (php) [Select]
		$buttons['home']['href'] = $scripturl . '?action=forum';

The next update must be manually changed again. Is there a better solution, someone has an idea?






Re: Bug with HomePage_0-0-1

Reply #1

 ::)  Does somebody has any idea?
Regards Stephan

Re: Bug with HomePage_0-0-1

Reply #2

In HomePage.integrate.php, replace the entire integrate_action_frontpage function with:
Code: [Select]
	public static function integrate_action_frontpage(&$default_action)
{
global $context, $board;

$default_action = array(
'file' => CONTROLLERDIR . '/HomePage.controller.php',
'controller' => 'HomePage_Controller',
'function' => 'action_homepage'
);

if (!empty($board) && !empty($context['linktree']))
{
foreach ($context['linktree'] as $key => $val)
{
if (strpos($val['url'], '#c') !== false)
{
$context['linktree'][$key]['url'] = str_replace('#c', '?action=forum#c', $context['linktree'][$key]['url']);
return;
}
}
}
}

A little fragile, but it should break only in some weird cases.
Bugs creator.
Features destroyer.
Template killer.

Re: Bug with HomePage_0-0-1

Reply #3

Is working  :) 

Many thanks
Regards Stephan