Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With verbose output on, a drupalGet and drupalPost both show the HTML page that the internal testing browser is working with.
With a drupalPostAJAX, the verbose output shows the AJAX commands instead.
This means that the developer is left in the dark as to what the internal browser now sees.
This can be fixed with a second call to verbose(), with the updated content.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2182315.12.drupal-7.simpletest-post-ajax-verbose.patch | 677 bytes | joachim |
#6 | 2182315.6.drupal.simpletest-post-ajax-verbose.patch | 788 bytes | joachim |
#2 | 2182315.drupal-7.simpletest-post-ajax-verbose.patch | 601 bytes | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedComment #2
joachim CreditAttribution: joachim commentedPatch for D7 which I'm uploading now so I don't lose it.
(This is obviously going to fail tests while the issue is set to the 8.x branch.)
Comment #4
joachim CreditAttribution: joachim commentedSetting to needs review.
That patch that needs review is the one that passed tests :)
Comment #5
mondrakeI wonder whether it would make sense to show also the path to the Ajax controller to which the Ajax request was sent to, i.e. something like
Other than that, it looks good to me: with the patch we get two 'verbose' debug lines for each call to drupalPostAjaxForm, one with the Ajax response and one with the updated content, which I believe is a good insight.
Comment #6
joachim CreditAttribution: joachim commentedDone!
Comment #7
mondrakeThank ypu!
Comment #8
catchCommitted/pushed to 8.x, thanks!
Comment #9
joachim CreditAttribution: joachim commentedThe D7 patch should be ready to go :)
Comment #10
joachim CreditAttribution: joachim commented2: 2182315.drupal-7.simpletest-post-ajax-verbose.patch queued for re-testing.
Comment #11
mondrakeWell :)
The patch in #2 does not contain the changes introduced in #6 for D8... and BTW in this case I believe we should have an 'Ajax callback' instead of an 'Ajax controller'.
Comment #12
joachim CreditAttribution: joachim commentedReroll with the changes form the D8 patch.
Comment #13
mondrakeLooks good, thanks!
Comment #14
David_Rothstein CreditAttribution: David_Rothstein commentedThis still looks pretty odd (at least in Drupal 7) since there are now two separate verbose messages... and the second always seems to say "Ending URL: internal:" before printing the page content. Nonetheless, it's definitely an improvement over what was there before, so I committed it to 7.x - thanks!