sarbian / ModuleManager

177 stars 95 forks source link

using :BEFORE and :AFTER on the same node #65

Closed Sigma88 closed 7 years ago

Sigma88 commented 7 years ago

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
    }
}
sarbian commented 7 years ago

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.

Sigma88 commented 7 years ago

ok, thanks for the info 👍