Problem/Motivation

If the network goes away during a multilingual installation a fatal error is triggered.

This is because locale_translation_http_check() calls methods on the return value of Guzzle's RequestException::getResponse() which may be NULL. See the API documentation for proof.

I triggered this via drush site-install but there's nothing Drush specific here, so I'm fairly certain it can be triggered through the UI as well.

Major because it's a fatal triggered from the UI and it's during the installation. (Not critical because it's sort of an edge case to hit.)

Proposed resolution

Check on the return value of RequestException::getResponse() before calling methods on it.

Remaining tasks

User interface changes

None.

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because fatal errors occur under certain conditions
Issue priority Major because because fatal errors
Unfrozen changes Unfrozen because it only changes code to reduce fragility
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Status: Active » Needs review
FileSize
920 bytes
1.75 KB

The -do-not-test patch is with git diff -w.

tstoeckler’s picture

Issue summary: View changes

Adding proof that the return value can be NULL to the IS.

jhedstrom’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This looks difficult to add a test for. The fix makes enough sense to me, since all it's doing is making sure a variable exists before calling a method on it.

I've added a beta phase evaluation to the issue summary.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 17e1827 on 8.0.x
    Issue #2362403 by tstoeckler: Fatal error during multilingual...
Gábor Hojtsy’s picture

Issue tags: +D8MI, +language-base

Post-tagging.

Status: Fixed » Closed (fixed)

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