Spin-off from #1215104: Use the non-interactive installer in WebTestBase::setUp()
Problem
drupal_save_session()
is not checked for the session regenerate and destroy cases.drupal_save_session()
does not persist across calls todrupal_static_reset()
.
Details
- From #1215104-41: Use the non-interactive installer in WebTestBase::setUp():
When injecting the
drupal_save_session()
condition that happens in the session commit and other callbacks into the regenerate and destroy callbacks, then the non-interactive installer magically starts to work.The Drupal installer is saving the
$user
for uid 1 to the (new) database, which is automatically logged in as the last step of the installation process.While everything happens in the child site under test, the PHP session handling happens in the global scope. Therefore, this
$user->save()
as well as theuser_login_finalize()
regenerate/destroy the session ID + session + cookies of the user that is running the test through the Simpletest UI.That, in turn, changes the value of
drupal_get_token()
, which Batch API saves and validates for each batch to be executed.
Proposed solution
- Make
drupal_session_regenerate()
,_drupal_session_destroy()
, anddrupal_session_destroy_uid()
adhere to the current flag ofdrupal_save_session()
. - Make the flag in
drupal_save_session()
persist (static).
Comment | File | Size | Author |
---|---|---|---|
#6 | drupal7-session_save-1688036-6.patch | 1.83 KB | lucascaro |
drupal8.session-save-false.0.patch | 1.85 KB | sun | |
Comments
Comment #1
sunComment #2
lucascaro CreditAttribution: lucascaro commentedmakes sense to me
Comment #3
sundrupal8.session-save-false.0.patch queued for re-testing.
Comment #4
sundrupal8.session-save-false.0.patch queued for re-testing.
Comment #5
catchLooks good to me. Committed/pushed to 8.x.
Comment #6
lucascaro CreditAttribution: lucascaro commentedHey, here's a port for D7.
Comment #7
lucascaro CreditAttribution: lucascaro commentedComment #8
sunThanks!
Comment #9
webchickI think this makes sense, and I suppose there's not really a way to test the tester.
Committed and pushed to 7.x. Thanks!