We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2954
    • 40 Posts
    I ran into a scenario with FirstChildRedirect.

    The variable $sortDir is set in the code to ’ASC’ by default:


    But the property set attached to it had sortDir set to ’DESC’ by default.

    That property set overwrote the code.

    It seems dangerous to have two places where variable defaults are set, particularly given that the property set over-writes the code.

    Perhaps the code should always take precedent, i.e. cascading style?
      • 28215
      • 4,149 Posts
      No, the code should *never* take precedent; otherwise it can not be overwritten. More than likely that’s just a typo on the default property set.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3749
        • 24,544 Posts
        If the code uses $modx->getOption(’value’,$scriptProperties, ’default’) to get the value (as it should), values sent as parameters will *always* override values set in an attached property set, which will in turn override any default property settings.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting