I have seen this bug for quite some time (at least since 3.6), and I just upgraded our test server to yesterday's 3.6.3+ to be sure that this was not fixed yet:
Whenever I want to add a role to a specific permission, either in a course or in an activity, the first time I click on the "plus" icon to add a role i get this:
TypeError: Cannot read property 'filter' of undefined at HTMLBodyElement.<anonymous> (https://moodletest.technikum-wien.at/vanilla/lib/requirejs.php/1554980238/core/first.js:57:2194) at HTMLBodyElement.e (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:39946) at HTMLBodyElement.dispatch (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:42349) at HTMLBodyElement.q.handle (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:40376) at Object.trigger (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:69719) at HTMLBodyElement.<anonymous> (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:70229) at Function.each (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:2715) at r.fn.init.each (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:1003) at r.fn.init.trigger (https://moodletest.technikum-wien.at/vanilla/lib/javascript.php/1554980238/lib/jquery/jquery-3.2.1.min.js:1:70205) at m (https://moodletest.technikum-wien.at/vanilla/lib/requirejs.php/1554980238/core/first.js:57:439)When I click again, it will work and present me with the role chooser.
When I then refresh the page with F5, I will get the same error again for my first click.
It seems unlikely to me that such a bug will have gone unnoticed for so long, yet I wasnt able to find a tracker item. Or does this just happen at my site? Can anyone reproduce this behaviour?