Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2015 at 00:52 UTC
Updated:
11 Oct 2015 at 23:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
othermachines commentedConfirmed (using latest 8.0.x). At first I thought I was imagining things.
Comment #3
asgorobets commentedThe issues was a bit tricky to find, but finally got it working.
First of all, there is already a separate submit handler for 'Clean environment' button, it's just not working properly under some circumstances.
Submit handlers attached to $form['clean']['op'] buttons are not executed when ticking at least one checkbox, but they are working fine when no checkboxes are ticked. This happens because Drupal does not identify correctly the triggered element. When ticking at least one checkbox, triggered element is considered the 'Run tests' button as it can't find the element (button) that was clicked in the form, and it has to default to the first button.
Button is missing in the $form because there is an early return happening when constructing $form array, if at least one of the tests is checked, then it will not construct the form again on submit, with this it will lose any evidence of 'clean' fieldset and 'op' button, that is added after this return statement.
In order to mitigate the issue I propose to move the 'clean' fieldset up and place it after the 'actions' element, so it is always rendered, even if the early return happens.
Please see patch attached.
Comment #4
lomo commentedI marked this is RTBC and made a comment yesterday, but there must have been a glitch since it's gone now.
I did test this, even after running some tests so that there really was an environment to 'clean' (that took a while, since I guess the tests I selected were not the simplest ones). And I verified the problem and that the solution seems to work, as advertised. I think this can be marked RTBC. Nice work, asgorobets. :-)
Comment #5
alexpottPermitted in beta since this is test related code and fixing a bug. Committed 983d2eb and pushed to 8.0.x. Thanks!