SiteCatalyst s.apl plug-in documentation for unique-check wrong?



Hi guys,

I was having a deeper look into the s.apl plug-in and stumbled upon something in the documentation which seems to be incorrect concerning the optional fourth parameter (see also

Documentation says: "u (optional, defaults to 0) Unique value check. 0=no unique check, value is always appended. 1=case-insensitive check, append only if value isn't in list. 2=case-sensitive check, append only if value isn't in list."

However, the example "Use case scenario 2" uses the case-sensitive check (2) to treat "History" and "history" as the same values?! 
Correct me if I'm wrong, but isn't that the definition of a case-insensitive check?

Having a look at the plug-in code indicates the same behavior:

... if(u){ var i,n,a=s.split(l,d);     for(i=0;i<a.length;i++){ n = a[i];         // u==1: equality check == case-sensitive         // u==2: toLowerCase comparison == case-insensitive m = m || ( u==1 ? (n==v) : (n.toLowerCase() == v.toLowerCase()) );     } } ...

So actually, passing "1" as value should be the case-sensitive check and "2" the case-insensitive check. 

This behavior most likely only causes issues if you're using it for (case-sensitive) list props but am I really the first person who encounters this problem?

Cheers from Switzerland,

View Entire Topic