We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    I have a context called 'secure'.
    There is a resource under my 'secure' context with ID 1671.

    From a resource on my 'web' context, I want to run a snippet that does this:
    $url = $modx->makeUrl(1671, 'secure','', 1);

    The call to makeURL is returning an empty string. Peeking under the hood, I can see in modx.class.php that the context appears to be the problem.

     else {
                        $ctx = $this->getContext($context);
                    }
    


    I can verify that $context is coming through as 'secure' and there is a context called 'secure'. But $ctx comes up empty.

    What am I doing wrong?
      • 22303 MODX Staff
      • 10,725 Posts
      Does this context have any ACL's? If so, make sure an anonymous user can "load" it.
        • 14883 ☆ A M B ☆
        • 450 Posts
        I did not have any ACLs set up on it - however, anonymous users were still able to directly load/view pages on that context (I'm on 2.1.3, I think the rules for load permissions on new contexts change as of 2.2.2).

        Just to be sure, I added a load/list/view ACL for my secure context to the anonymous group, but that didn't help.