It has been half a year since I posted #699434: Workaround check for dom support for D6. There's a similar problem with D7 and I've finally traced it down to a failure of DOMDocument::loadHTML() (callstack: drupalLogin() -> drupalPost() -> drupalGet() -> checkForMetaRefresh() -> parse()).

The failure is masked by an @ prefix, but the call to DOMDocument::loadHTML() branches to _drupal_shutdown_function(), and for the user it looks like the batch hangs.

Removing the @ prefix got me this:

Fatal error: Call to undefined method domdocument::loadHTML() in drupal-7\modules\simpletest\drupal_web_test_case.php on line 1528

The solution according to #786288-2: Call to undefined method domdocument::loadHTML() (commenting out extension=php_domxml.dll in php.ini) worked for me — Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

simpletest.module should detect the error condition and provide the work-around to the user. I can provide testing, but I don't know how to implement it.

(DOMDocument::loadHTML() is used twice in drupal_web_test_case.php and also in filter.module.)

CommentFileSizeAuthor
#4 851058-dom-check.patch731 bytesboombatower
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Simpletest already have a requirement check for the DOMDocument class. The system module also have a requirement check for the 'dom' extension. What kind of weird set up do you have for both those tests to fail?

salvis’s picture

Plain vanilla XAMPP 1.7.1 on Win7 64-bit.

Note: it's not that 'dom' was missing, but 'xmldom' (or 'domxml') was somehow conflicting and had to be removed!

Damien Tournoud’s picture

Oh PHP is broken in a number of interesting ways :)

The fix would be to switch, in simpletest.install, from:

  $has_domdocument = class_exists('DOMDocument');

to:

  $has_domdocument = method_exists('DOMDocument', 'loadHTML');

Care to provide a patch?

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Needs review
FileSize
731 bytes
Damien Tournoud’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.