Brand Header

Hi there,

first things first: Thanks for conceiving and maintaining this excellent theme component, @vinothkannans! We started to lean on it recently and have been glad there was finally a flexible header component which we still missed about two years ago when configuring our first Discourse instance.

Introduction

@LittleLebowsky discovered some bugs on the account activation page on a site which uses the brand header theme component, so we started digging for the reason behind that and would like to share the outcome with you again.

We discovered some minor things which could be improved. It is about Brand header theme component breaks page layout on static and no_ember pages and might sound familiar to some of you already. @vinothkannans also already answered me at TypeError: Discourse._registerPluginCode is not a function - #4 by vinothkannans while I was searching for the root cause of this issue, thanks for that!

Workaround

  1. We came up with an appropriate workaround which at least will assure the rendering will not break completely. It does so by effectively not displaying the brand header at all when not getting runtime-initialized. You can find the corresponding PR at https://github.com/discourse/discourse-brand-header/pull/2.

  2. Because the component is still attempted to get ill-initialized on static and no_ember pages, you might want to additionally apply this snippet to a custom theme component, which effectively makes plugin registration a noop, see also TypeError: Discourse._registerPluginCode is not a function - #7 by amotl.
    This step can be omitted completely as soon as Almost void Discourse object instance will sneak through some safeguards will be fixed.

Preliminary testing

If you want to try it out, you might want to use this repository with the designated branch name for importing the component:

Repository:  https://github.com/ip-tools/discourse-brand-header
Branch name: fix-broken-rendering

Hope this helps.

With kind regards,
Andreas.

2 Likes