bootstrap.php causes error in Theme.php
September 17, 2017, 03:36:33 pm
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
Re: bootstrap.php causes error in Theme.php
Reply #2 – September 17, 2017, 04:07:55 pm
Thanks. (Wasn't sure where you wanted that fix.)
Re: bootstrap.php causes error in Theme.php
Reply #3 – September 17, 2017, 04:09:42 pm
emanuele
Global Moderator
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.
Re: bootstrap.php causes error in Theme.php
Reply #4 – September 17, 2017, 04:56:23 pm
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.
Re: bootstrap.php causes error in Theme.php
Reply #5 – September 17, 2017, 05:37:58 pm
emanuele
Global Moderator
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.