Variable {$loggedInUsername} not recognized

hello everyone.
i found another problem, this time with a variable. some one know how to fix?

image

i also got this warning

Warning: Smarty error: FBV: Element ID not set in /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/Smarty.class.php on line 1094

@asmecher :slight_smile:

Hi @falexandremc

This is not a problem, I believe – it just means that the navigation item would have the username of the currently logged in user…

Best,
Bozana

yes, but,
if the Variable loggedInUsername is not set it can not be used on another places as well such a log or a cvs report. and this is a problem. did u have any clue of how to fix it?

I do not know the templates (what template shows what), but do know that Smarty will process any placeholder, such as {$loggedInUserName}. Smarty will not simply leave that placeholder as a placeholder even if there is no value assigned to that variable. The placeholder will be replaced with a zero-length string.

The only way that a Smarty placeholder will appear in the final output is if that template (or template element) somehow escapes Smarty’s attention, of if the Smarty commands {literal} and {/literal} enclose the placeholder, or {ldelim} or {ldelim} are used to show actual braces, or if the braces are expressed as something other than braces: { and }.

Do we know what template the anomalous content is in?

Found it in \registry\navigationMenus.xml. The next question is, does OJS process this XML file to a string and then pass it through Smarty->fetch()?

I would think it does not, but accidentally? or never was designed to do so?

The variable can be used in any template – it is not meant to be somewhere else, I believe.
Where would you for example like to use it and how?

hello bsmither. so do you think that the {$loggedInUserName} was put in there because the person that put it think that he or she would implement latter but never had?