コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getContextValue($name)
 {
     try {
         return parent::getContextValue($name);
     } catch (ContextException $e) {
         // Catch the undocumented exception thrown when no context value is set
         // for a required context.
         // @todo: Remove once https://www.drupal.org/node/2677162 is fixed.
         if (strpos($e->getMessage(), 'context is required') === FALSE) {
             throw $e;
         }
     }
 }