Every once in a while XWiki 10.7 (Windows 7, MySQL 5.7, Tomcat 8.5.24) forgets macro definitions. I have to dummy-save them, to get them registered again. Any idea, how this could happen? Thanks, Guido
Hi Guido. Hmm that doesn’t ring a bell.
Have you wiki restarted when you notice that the macro(s) are not available anymore?
If the wiki has not restarted then I don’t see how it can happen at all. The only way for a wiki macro to disappear is for it to be unregistered, i.e. the page it’s contained in has been deleted (or some manual scripting to explicitly remove it).
Actually I have an idea: When you modify a wiki macro’s page and save it, it’ll first unregister the macro and register it again. Maybe the registration fails for some reason (you should have info on the screen and in xwiki’s logs) and thus the macro is not available anymore?
@tmortagne: I see that in several places we only output debug logs on errors, this is weird to me and wrong. I think we should log as WARN, WDYT? Here are 2 places:
- xwiki-platform/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-api/src/main/java/org/xwiki/rendering/internal/macro/wikibridge/WikiMacroEventListener.java at 94966d9771b1770f0c9676fd441aff4e0b8dcee8 · xwiki/xwiki-platform · GitHub
- xwiki-platform/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-api/src/main/java/org/xwiki/rendering/internal/macro/wikibridge/WikiMacroEventListener.java at 94966d9771b1770f0c9676fd441aff4e0b8dcee8 · xwiki/xwiki-platform · GitHub
Seems it’s me who did this in XWIKI-4671: Add ability to register Wiki Macros only for a given Wiki… · xwiki/xwiki-platform@30aab34 · GitHub I don’t know why but it seems it would be hard for the user to know the problem. WDYT?
Okay, that helps. The macro is attached to an AppWithinMinutes page. I get very often errors when saving changes to an AppWithinMinutes (server not responding or the like). I’ll move the macro to a separate page.
Anyway, turning the debug messages into warning messages would help.
Cheers
Guido
Thanks!