Bitweaver - Themes - Bugs
-
One of the problems with the new tighter typing of variables in PHP8.x is that one can't simply assume that the if something does not exist yet it will return false or 0 as it used to. So we have to ensure that values are set in a template. Since the master $gContent value is normally available even for a blank page then it should return suitable sub-variables, but currently that is not the case. Liberty module perhaps needs to be updated to ensure things like $gContent->mContentId is set, but in the meantime
{if !empty($gContent)}{assign var=mContentId value=$gContent->mContentId}{else}{assign var=mContentId value=0}{/if}can be added to templates that assume it is 0 is not set. A number of areas need this treatment, along with custom overrides in the site specific themes. rainbowdigitalmedai for instance uses the mContentId to highlight the selected page on the top meny, but gives warning messages if the page is not actually defined. Something I've just fixed and pinched this code from.
-
Need to work out what needs to be done with {code}This is a code box{/code} to make it work.
-
Rationalise templates and stril all raw php code from them, although empty($var) is useful to check if there is something to work on.
