We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7327
    • 195 Posts
    Hi Lucas,

    I'm using your AndIf snippet on a XAMPP 1.8.1 installation and a recently moved site using MODX REVO 2.2.5 and 2.2.6PL. On my original installation of XAMPP (1.7.1 b5), I didn't have problems with it, but in this new installation, I'm encountering this PHP Notice message:

    <b>Notice</b>: Use of undefined constant compareSubject - assumed 'compareSubject' in <b>E:\xampp\htdocs\mysite\core\cache\includes\elements\modsnippet\15.include.cache.php</b> on line <b>59</b>

    Not sure why this is appearing.. Have you encountered this before?

    Very useful snippet by the way smiley

    Update:

    Found the answer in this thread:

    http://stackoverflow.com/questions/2509624/php-use-of-undefined-constant-error

    It seems the error is caused by the lack of quotes in line 53:

    if(!function_exists(compareSubject)) {

    So to fix this, I just added the " and " before and after compareSubject:

    if(!function_exists("compareSubject")) {

    In case anyone's encountering this problem tongue
    [ed. note: diatomin last edited this post 11 years, 3 months ago.]
      • 33968
      • 863 Posts
      @diatomin: silly error, I've fixed it now and uploaded the changes. See the first post in this thread and download the second file shown (there's an error when I try to remove the first).

      Glad it's useful for you, I'll admit I haven't used it for a long time wink
        • 7327
        • 195 Posts
        Thanks bro! If only the IF snippet came with a multi condition feature. Hehehe!
        • I needed to say thank you cause I spent the most of yesterday trying to achieve an IF statement that never worked until I found this snippet and solved the problem: http://forums.modx.com/thread/91074/output-wayfinder-based-resource-type-container-or-child#dis-post-498771

          All other if statement or Output Modifiers failed or were inconsistentor on the parent or child resources.
            • 40090
            • 8 Posts
            Great snippet, very usefull! Thanx dude smiley