[Home]TransclusionLoop

MeatballWiki | RecentChanges | Random Page | Indices | Categories

If you transclude WikiOne? into WikiTwo? an then WikiTwo? into WikiOne?, when loading WikiOne?, WikiTwo? would be loaded and would try to load WikiOne? again, creating a TransclusionLoop?.

When implementing TransClusion there should be some kind of loaded wikis list, to prevent them from loading again.

This would also prevent a wiki from transcluding itself.

The solution to the recursion problem is the same as any graph traversal where you might have a cycle. Just maintain a stack of visited nodes. When encountering a new node, scan the stack for that new node. If it exists in the stack, then it's already been visited in this arc, so don't process that new node.


Discussion

MeatballWiki | RecentChanges | Random Page | Indices | Categories
Edit text of this page | View other revisions | Search MetaWiki
Search: