diff options
author | Badlop <badlop@process-one.net> | 2009-01-16 16:06:21 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-01-16 16:06:21 +0000 |
commit | 43e12a37025c5363ad74e12e08bd180caeb629d3 (patch) | |
tree | 875eacc0f8e4757c83c030ce365443edf2c7441d /src/mod_privacy_odbc.erl | |
parent | * doc/release_notes_2.0.3.txt: Minor changes (diff) |
* src/mod_privacy.erl: Privacy list items must be processed in the
specified order (EJAB-848)
* src/mod_privacy_odbc.erl: Likewise
SVN Revision: 1822
Diffstat (limited to 'src/mod_privacy_odbc.erl')
-rw-r--r-- | src/mod_privacy_odbc.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mod_privacy_odbc.erl b/src/mod_privacy_odbc.erl index 1fdf799d..aac29552 100644 --- a/src/mod_privacy_odbc.erl +++ b/src/mod_privacy_odbc.erl @@ -414,7 +414,12 @@ parse_items(Els) -> parse_items(Els, []). parse_items([], Res) -> - lists:reverse(Res); + %% Sort the items by their 'order' attribute + %% 5 is the position of 'order' attribute in a #listitem tuple + %% This integer can be calculated at runtime with: + %% 2 + length(lists:takewhile(fun(E) -> E =/= order end, + %% record_info(fields, listitem))), + lists:keysort(5, Res); parse_items([{xmlelement, "item", Attrs, SubEls} | Els], Res) -> Type = xml:get_attr("type", Attrs), Value = xml:get_attr("value", Attrs), |