MDL-65538 competency: fix behat errors with firefox
authorSara Arjona <sara@moodle.com>
Mon, 15 Jul 2019 11:48:53 +0000 (13:48 +0200)
committerSara Arjona <sara@moodle.com>
Mon, 15 Jul 2019 11:48:56 +0000 (13:48 +0200)
There is a random behat error when executing the "Go to the competency
course competencies page." scenario: "Moodle exception: A required parameter
(courseid) was missing More information about this error".
It happens because sometimes the form is sent before the JS and it hasn't
the needed parameters defined. So they have been added as hidden to the
form to avoid the error (which I couldn't reproduce manually).

admin/tool/lp/templates/module_navigation.mustache
admin/tool/lp/templates/user_competency_course_navigation.mustache
report/competency/templates/user_course_navigation.mustache

index aa10239..6fd1da9 100644 (file)
@@ -30,6 +30,8 @@
 }}
 <div class="float-right card p-2">
 <form class="user-competency-course-navigation">
+<input type="hidden" name="courseid" value="{{courseid}}"/>
+<input type="hidden" name="mod" value="{{moduleid}}"/>
 {{#hasmodules}}
 <span>
 <label for="module-nav-{{uniqid}}" class="accesshide">{{#str}}filterbyactivity, tool_lp{{/str}}</label>
index 331c3e1..9bced6b 100644 (file)
@@ -38,6 +38,9 @@
 <div class="float-sm-right card card-block p-x-1 p-b-1">
 <p>{{{groupselector}}}</p>
 <form class="user-competency-course-navigation">
+<input type="hidden" name="userid" value="{{userid}}"/>
+<input type="hidden" name="competencyid" value="{{competencyid}}"/>
+<input type="hidden" name="courseid" value="{{courseid}}"/>
 {{#hasusers}}
 <span>
 <label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
index ad430a6..2ee6564 100644 (file)
@@ -25,6 +25,9 @@
 <div class="float-right card p-x-1 p-b-1">
 <p>{{{groupselector}}}</p>
 <form class="user-competency-course-navigation">
+<input type="hidden" name="user" value="{{userid}}"/>
+<input type="hidden" name="id" value="{{courseid}}"/>
+<input type="hidden" name="mod" value="{{moduleid}}"/>
 {{#hasusers}}
 <span>
 <label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>