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?
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
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.