diff --git a/core/lib/Drupal/Core/Image/Image.php b/core/lib/Drupal/Core/Image/Image.php index 6d4da44..4d2611b 100644 --- a/core/lib/Drupal/Core/Image/Image.php +++ b/core/lib/Drupal/Core/Image/Image.php @@ -286,6 +286,14 @@ protected function processInfo() { * @todo Drop this in https://drupal.org/node/2073759 in favor of new apply(). */ public function __call($method, $arguments) { + // @todo Temporary to avoid that legacy GD setResource(), getResource(), + // hasResource() methods moved to GD toolkit in #2103621 get invoked + // from this class anyway through the magic __call. Will be removed + // through https://drupal.org/node/2073759, when call_user_func_array() + // will be replaced by $this->toolkit->apply($name, $this, $arguments). + if (in_array($method, array('setResource', 'getResource', 'hasResource'))) { + throw new \BadMethodCallException(); + } if (is_callable(array($this->toolkit, $method))) { // @todo In https://drupal.org/node/2073759, call_user_func_array() will // be replaced by $this->toolkit->apply($name, $this, $arguments).