On Thu, Oct 8, 2009 at 8:20 PM, Jeffrey Euen-Gow <clubbeyours...@yahoo.co.uk> wrote: > When clicking on the connect link at the top of the window (as a logged in > user) when the templating system is active the twitter and facebook tabs do > not show up. > > Also clicking on register when the templating system is active the Login, > Register, OpenID, facebook options are missing, > > the same for clicking on login Login, Register, OpenID, facebook option tabs > are missing. > > Am I missing something in the /tpl/index.php file or am i missing something > in the /plugin/TemplatePlugin.php file > > The template that I have created is not that different to the default so > there have been few changes to the /tpl/index.php file.... I have not made > any changes to the /plugin/TemplatePlugin.php file.. Is this a bug in the > software and the use of the templating system when using the available > plugins, such as twitter, facebook, opened, etc....
You're not missing anything - the Template and Facebook Connect plugins aren't playing nicely together :-) The issue(s) are with how multiple plugins interact in general. The Template plugin listens to both start local nav and end local nav events to capture the HTML output. The Facebook Connect plugin overrides the local nav (tabs) to add the Facebook tab, so on the start event, it inserts its own HTML then returns false. There are two problems. First, depending on which order the plugins are added, the Template start event handler may not be called at all. Currently, Event::handle() stops calling event handlers when it gets a false return value, so if the FC start event handler is called first, the Template start event handler won't be called. Second, the event triggering code looks like this: trigger start event if (no event handler wants to override the default code) { do default stuff trigger end event } So if the start event handler overrides the default code, the end event is never triggered. In this case, the FB start event handler only outputs its nav HTML and doesn't trigger the end event, so the Template end event handler is never called (and so no nav HTML gets to the output page). I propose two changes: 1) Change Event::handle() to call all registered handlers, instead of stopping after the first false return value. 2) Change all event triggering code to always trigger the end event, i.e. move it out of the if block. I don't know if there are any side-effects from these, which is why I'm not submitting merge requests already. Thanks, Jeff _______________________________________________ StatusNet-dev mailing list StatusNet-dev@lists.status.net http://lists.status.net/mailman/listinfo/statusnet-dev