Policies referenced multiple times in data structures processed by the Quotas module
Debugging an issue where the counter in the quotas_tracking table was set to NULL we detected that in the policy matching code policies with multiple members (I hope that's the right term) which the current message matched resulted in multiple references to the same policy in the resulting data structures.
Since such a situation is not foreseen in the code of the Quotas module, that code breaks resulting in NULLs written in the Counter field of the aforementioned table.
Below an example of a log with the incorrect data structures:
[...]
[2014/03/27-17:22:26 - 32752] [POLICIES] DEBUG: END RESULT: prio=0 => policy ids: 1
[2014/03/27-17:22:26 - 32752] [POLICIES] DEBUG: END RESULT: prio=10 => policy ids: 3,3
[2014/03/27-17:22:26 - 32752] [TRACKING] DEBUG: Policy resolved into: $VAR1 = {
'0' => [
'1'
],
'10' => [
'3',
'3'
]
};
[...]
'_Recipient_To_Policy' => {
'xxxx@xxxxx.com' => {
'0' => [
'1'
],
'10' => [
'3',
'3'
]
}
},
[...]
This commit solves the problem in our case.