Update CRM_Utils_Rule::mysqlOrderBy() to accommodate more than 2 joins
Currently sorting only allows up to 2 joins: "membership_id.contact_id". If we go up a further level like "membership_id.contact_id.contact_type" it throws an error. I suggest changing the regex:
if (!preg_match('/^((`[\w-]{1,64}`|[\w-]{1,64})\.)?(`[\w-]{1,64}`|[\w-]{1,64})( (asc|desc))?$/i', trim($part))) {
return FALSE;
}
}```
to:
```/^((`[\w-]{1,64}`|[\w-]{1,64})\.)```{+ + +}```?(`[\w-]{1,64}`|[\w-]{1,64})( (asc|desc))?$/i```