Multilang filter is causing infinite loops when the parent of a language pack is not listed in the "langlist" setting.
The loop is triggered by MDL-55197 calling get_parent_lang().
http://git.moodle.org/gw?p=moodle.git;a=blob;f=filter/multilang/filter.php;h=2e9bac35575eef0fb4befea4b5eb7ce98e9c2c92;hb=0925ecdbd4b4ed6d82eab91364d870835bd1a418#l105
When trying to switch the user language to "fr_ca", the site will end up in an infinite loop if "fr", the parent of "fr_ca" is not listed in langlist.
As a workaround, adding "fr" to langlist makes the site behave normally.
The bug is caused by moodlelib.php function get_parent_language() trying to hack around the current language, but failing to switch to "fr" since "fr" is not in langlist.
http://git.moodle.org/gw?p=moodle.git;a=blob;f=lib/moodlelib.php;h=e2016a8bf75824ef84096ee27e3c573498eb38b5;hb=refs/heads/MOODLE_36_STABLE#l7018
We have found the solution proposed in MDL-66197 to fix this bug, so perhaps it should be applied from version 3.6 upwards.