XWIKI-9905: Fix the foreach loop

* Insert the line of adding member in a map into the foreach loop