Testing a custom add-on in 1.1 RC2. It calls a php function via javascript from the Display page. First line is require(appropriate path/SSI.php) . SSI.php then does require_once(appropriate path/bootstrap.php).
This eventually calls setupThemeContext() which produces the following error.
PHP Notice: Undefined index: default_forum_action in forum/themes/default/Theme.php on line 737
This didn't happen in 1.0.x
hmm...
That should do for the moment.
In bootstrap.php search for:
else
{
setupThemeContext();
}
and change it to:
else
{
if (!empty($modSettings['front_page']) && is_callable(array($modSettings['front_page'], 'frontPageHook')))
{
$modSettings['default_forum_action'] = '?action=forum;';
}
else
{
$modSettings['default_forum_action'] = '';
}
setupThemeContext();
}
I would prefer to have this code somewhere else, but honestly I can't see a good place for it at the moment.
Thanks. (Wasn't sure where you wanted that fix.)
I'm not sure either. xD
To be honest, at that point I'm not sure the code belongs to the dispatcher to begin with.
I'm not sure what the actual point of creating bootstrap is, but given it's name I would think both SSI and the dispatcher should call it for common start up.
The idea behind bootstrap is to extract from the SSI the logic that allows to start Elk and make it standalone.
SSI would become then just a sort of "demo" of how to use bootstrap, providing few functions as goodie.
In an ideal world I would use bootstrap at the beginning of index.php too, but... there are few differences that I didn't want to tackle.
The missing index here, instead is part of the "new feature" in 1.1 that allows controllers to be able to acts as the "home page" and is a sort of hack I had to put together in order to fix an issue.
So, when I introduced this index I put it in the dispatcher because it seemed to work well, but now I'm not sure any more.
This doesn't seem exterminated. Or at least I don't know how to use the new system. I set ssi_layers in my front page and I still get the same error with your change. Not surprising as your change is in an else clause after if(isset($ssi_layers)).
I added $modSettings['default_forum_action'] = '' to the if statement.
// Load the stuff like the menu bar, etc.
if (isset($ssi_layers))
{
******************************************************************
Added this to make SSI happy
$modSettings['default_forum_action'] = '';
******************************************************************
$template_layers = Template_Layers::instance();
$template_layers->removeAll();
foreach ($ssi_layers as $layer)
{
$template_layers->addBegin($layer);
}
template_header();
}
else
{
if (!empty($modSettings['front_page']) && is_callable(array($modSettings['front_page'], 'frontPageHook')))
{
$modSettings['default_forum_action'] = '?action=forum;';
}
else
{
$modSettings['default_forum_action'] = '';
}
setupThemeContext();
}
Please try the change here: https://github.com/emanuele45/Dialogo/commit/18c8e0dd8eadaf1e0435c4064dad5351bd20917b which moves most of that else statement before the if/else stuff.
That version works. :)