sarbian/ModuleManager

using :BEFORE and :AFTER on the same node

Closed this issue · 2 comments

not sure if this is how MM is intended to work, or if it's a bug so I'll just leave this here to discussion

when doing something like:

TESTNODE
{
	name = testnode
}
@TESTNODE:FOR[MOD]
{
	mod = now
}
@TESTNODE:BEFORE[MOD]:AFTER[MOD]
{
	runs = now
}

basically, I wanted to check if I could use :BEFORE[MOD]:AFTER[MOD] to run the same patch 2 times once before and once after a certain mod

I was expecting 2 results, either:

1- The patch runs only at :BEFORE[] because it's the first condition that is met and then the patch is "deleted"

2- The patch runs both before and after the mod

of course, it didn't run at all :D

if this is not intended I can share logs

EDIT:
to clarify, MM throws no errors. but the cache only shows:

UrlConfig
{
	name = testnode
	type = TESTNODE
	parentUrl = /test1
	url = /test1/testnode
	TESTNODE
	{
		name = testnode
		mod = now
	}
}

when if I use 2 different patches, one with BEFORE and one with AFTER the result is as you would expect:

UrlConfig
{
	name = testnode
	type = TESTNODE
	parentUrl = /test1
	url = /test1/testnode
	TESTNODE
	{
		name = testnode
		runs = now
		mod = now
		runs = now
	}
}

Yep, it should not work at all because the parser does not handle that case. It will try to find a node named '@testnode:BEFORE[MOD]' to patch it.
And making it run twice would be quite a pain.

ok, thanks for the info 👍