Include issue: "Cannot make recursive include" message

Hello,
I created a nice navbar/menu and to add it on top of my xwiki site, I added a $xwiki.includeform in ./skins/flamingo/global.vm file

  </div> ## globallinks
  <div class="clearfloats"></div>
### Mon menu personnalisé
#if ($xcontext.user != 'XWiki.XWikiGuest') ##affiche seulement si user connecté
  $xwiki.includeForm("Personnalisation.Menu.Content.WebHome")
#end
  #foreach ($uix in $services.uix.getExtensions('org.xwiki.platform.template.header.after', {'sortByParameter': 'order'}))
    $services.rendering.render($uix.execute(), 'xhtml/1.0')

It work nicely except when I’m on my inserted page “Personnalisation.Menu.Content.WebHome”, my navbar displayed only “Cannot make recursive include” error message.
I wonder why?

I have the same issue when using this custom ./skins/flamingo/footer.vm

<div id="footerglobal">
#if ($xcontext.user != 'XWiki.XWikiGuest') ##affiche seulement si connecté
  $xwiki.includeForm("Personnalisation.PiedDePage")
#end
</div>
#end

Thxs
Pascal B

Do you have a tip ta remove this error message?

The code is:

                    if (includedDocs.contains(prefixedTopic) || currentDocName.equals(prefixedTopic)) {
                        LOGGER.warn("Error on too many recursive includes for topic " + topic);
                        return "Cannot make recursive include";
                    }

So XWiki is protecting you from doing a stackoverflow with a cyclic include :wink:

Ok thxs but my include is not a cyclic include…
Then I can not avoid this error message ?

Then I suppose I must use this code:

<div id="footerglobal">
#if ($xcontext.user != 'XWiki.XWikiGuest'&&$doc!="Personnalisation.PiedDePage") ##affiche seulement si connecté
  $xwiki.includeForm("Personnalisation.PiedDePage")
#end
</div>