Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542

This commit is contained in:
Pantheon Automation 2015-08-27 12:03:05 -07:00 committed by Greg Anderson
parent 3b2511d96d
commit 81ccda77eb
2155 changed files with 54307 additions and 46870 deletions

View file

@ -20,7 +20,7 @@ use Symfony\Component\Config\Resource\FileResource;
*
* @author singles
*/
class JsonFileLoader extends ArrayLoader implements LoaderInterface
class JsonFileLoader extends ArrayLoader
{
/**
* {@inheritdoc}
@ -35,10 +35,13 @@ class JsonFileLoader extends ArrayLoader implements LoaderInterface
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
}
$messages = json_decode(file_get_contents($resource), true);
$messages = array();
if ($data = file_get_contents($resource)) {
$messages = json_decode($data, true);
if (0 < $errorCode = json_last_error()) {
throw new InvalidResourceException(sprintf('Error parsing JSON - %s', $this->getJSONErrorMessage($errorCode)));
if (0 < $errorCode = json_last_error()) {
throw new InvalidResourceException(sprintf('Error parsing JSON - %s', $this->getJSONErrorMessage($errorCode)));
}
}
if (null === $messages) {

View file

@ -116,7 +116,7 @@ class MoFileLoader extends ArrayLoader
$messages = array();
for ($i = 0; $i < $count; $i++) {
for ($i = 0; $i < $count; ++$i) {
$singularId = $pluralId = null;
$translated = null;

View file

@ -148,7 +148,7 @@ class XliffFileLoader implements LoaderInterface
$source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source);
if (!@$dom->schemaValidateSource($source)) {
throw new InvalidResourceException(implode("\n", $this->getXmlErrors($internalErrors)));
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors))));
}
$dom->normalizeDocument();