Update to Drupal 8.1.2. For more information, see https://www.drupal.org/project/drupal/releases/8.1.2
This commit is contained in:
parent
9eae24d844
commit
28556d630e
1322 changed files with 6699 additions and 2064 deletions
|
@ -169,5 +169,4 @@ class AccessManager implements AccessManagerInterface {
|
|||
return $service_access;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -61,4 +61,5 @@ interface CheckProviderInterface {
|
|||
* @return array
|
||||
*/
|
||||
public function getChecksNeedRequest();
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,5 @@ class CloseDialogCommand implements CommandInterface {
|
|||
'persist' => $this->persist,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,4 +16,5 @@ interface CommandInterface {
|
|||
* Return an array to be run through json_encode and sent to the client.
|
||||
*/
|
||||
public function render();
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ class DataCommand implements CommandInterface {
|
|||
* A CSS selector for the elements to which the data will be attached.
|
||||
* @param string $name
|
||||
* The key of the data to be attached to elements matched by the selector.
|
||||
* @param type $value
|
||||
* @param mixed $value
|
||||
* The value of the data to be attached to elements matched by the selector.
|
||||
*/
|
||||
public function __construct($selector, $name, $value) {
|
||||
|
|
|
@ -33,4 +33,5 @@ class OpenModalDialogCommand extends OpenDialogCommand {
|
|||
$dialog_options['modal'] = TRUE;
|
||||
parent::__construct('#drupal-modal', $title, $content, $dialog_options, $settings);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ class RemoveCommand implements CommandInterface {
|
|||
* Constructs a RemoveCommand object.
|
||||
*
|
||||
* @param string $selector
|
||||
*
|
||||
*/
|
||||
public function __construct($selector) {
|
||||
$this->selector = $selector;
|
||||
|
|
|
@ -23,4 +23,5 @@ class SetDialogTitleCommand extends SetDialogOptionCommand {
|
|||
$this->optionName = 'title';
|
||||
$this->optionValue = $title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,4 +56,5 @@ interface ArchiverInterface {
|
|||
* An array of file names relative to the root of the archive.
|
||||
*/
|
||||
public function listContents();
|
||||
|
||||
}
|
||||
|
|
|
@ -87,4 +87,5 @@ class Tar implements ArchiverInterface {
|
|||
public function getArchive() {
|
||||
return $this->tar;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,4 +89,5 @@ class Zip implements ArchiverInterface {
|
|||
public function getArchive() {
|
||||
return $this->zip;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class AssetDumper implements AssetDumperInterface {
|
|||
public function dump($data, $file_extension) {
|
||||
// Prefix filename to prevent blocking by firewalls which reject files
|
||||
// starting with "ad*".
|
||||
$filename = $file_extension. '_' . Crypt::hashBase64($data) . '.' . $file_extension;
|
||||
$filename = $file_extension . '_' . Crypt::hashBase64($data) . '.' . $file_extension;
|
||||
// Create the css/ or js/ path within the files folder.
|
||||
$path = 'public://' . $file_extension;
|
||||
$uri = $path . '/' . $filename;
|
||||
|
|
|
@ -214,7 +214,7 @@ class AssetResolver implements AssetResolverInterface {
|
|||
// hook_library_info_alter(). Additionally add the current language to
|
||||
// support translation of JavaScript files via hook_js_alter().
|
||||
$libraries_to_load = $this->getLibrariesToLoad($assets);
|
||||
$cid = 'js:' . $theme_info->getName() . ':' . $this->languageManager->getCurrentLanguage()->getId() . ':' . Crypt::hashBase64(serialize($libraries_to_load) . serialize($assets->getLibraries())) . (int) (count($assets->getSettings()) > 0) . (int) $optimize;
|
||||
$cid = 'js:' . $theme_info->getName() . ':' . $this->languageManager->getCurrentLanguage()->getId() . ':' . Crypt::hashBase64(serialize($libraries_to_load) . serialize($assets->getLibraries())) . (int) (count($assets->getSettings()) > 0) . (int) $optimize;
|
||||
|
||||
if ($cached = $this->cache->get($cid)) {
|
||||
list($js_assets_header, $js_assets_footer, $settings, $settings_in_header) = $cached->data;
|
||||
|
|
|
@ -163,7 +163,7 @@ class CssOptimizer implements AssetOptimizerInterface {
|
|||
$directory = dirname($filename);
|
||||
// If the file is in the current directory, make sure '.' doesn't appear in
|
||||
// the url() path.
|
||||
$directory = $directory == '.' ? '' : $directory .'/';
|
||||
$directory = $directory == '.' ? '' : $directory . '/';
|
||||
|
||||
// Alter all internal url() paths. Leave external paths alone. We don't need
|
||||
// to normalize absolute paths here because that will be done later.
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace Drupal\Core\Cache;
|
|||
*
|
||||
* @ingroup cache
|
||||
*/
|
||||
|
||||
class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterface {
|
||||
|
||||
/**
|
||||
|
|
|
@ -76,10 +76,10 @@ class Cache {
|
|||
*/
|
||||
public static function mergeMaxAges($a = Cache::PERMANENT, $b = Cache::PERMANENT) {
|
||||
// If one of the values is Cache::PERMANENT, return the other value.
|
||||
if ($a === Cache::PERMANENT){
|
||||
if ($a === Cache::PERMANENT) {
|
||||
return $b;
|
||||
}
|
||||
if ($b === Cache::PERMANENT){
|
||||
if ($b === Cache::PERMANENT) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,4 +215,5 @@ interface CacheBackendInterface {
|
|||
* Remove a cache bin.
|
||||
*/
|
||||
public function removeBin();
|
||||
|
||||
}
|
||||
|
|
|
@ -54,4 +54,5 @@ interface CacheTagsChecksumInterface {
|
|||
* This is only used by tests.
|
||||
*/
|
||||
public function reset();
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Drupal\Core\Cache;
|
|||
* Defines a generic class for passing cacheability metadata.
|
||||
*
|
||||
* @ingroup cache
|
||||
*
|
||||
*/
|
||||
class CacheableMetadata implements RefinableCacheableDependencyInterface {
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ class CacheContextsManager {
|
|||
* @return \Drupal\Core\Cache\Context\ContextCacheKeys
|
||||
* The ContextCacheKeys object containing the converted cache keys and
|
||||
* cacheability metadata.
|
||||
*
|
||||
*/
|
||||
public function convertTokensToKeys(array $context_tokens) {
|
||||
assert('$this->assertValidTokens($context_tokens)');
|
||||
|
@ -195,7 +194,7 @@ class CacheContextsManager {
|
|||
$ancestor_found = TRUE;
|
||||
}
|
||||
|
||||
} while(!$ancestor_found && strpos($ancestor, '.') !== FALSE);
|
||||
} while (!$ancestor_found && strpos($ancestor, '.') !== FALSE);
|
||||
if (!$ancestor_found) {
|
||||
$optimized_content_tokens[] = $context_token;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use Drupal\Core\Language\LanguageManagerInterface;
|
|||
/**
|
||||
* Defines the LanguagesCacheContext service, for "per language" caching.
|
||||
*/
|
||||
class LanguagesCacheContext implements CalculatedCacheContextInterface {
|
||||
class LanguagesCacheContext implements CalculatedCacheContextInterface {
|
||||
|
||||
/**
|
||||
* The language manager.
|
||||
|
|
|
@ -27,8 +27,17 @@ class QueryArgsCacheContext extends RequestStackCacheContextBase implements Calc
|
|||
if ($query_arg === NULL) {
|
||||
return $this->requestStack->getCurrentRequest()->getQueryString();
|
||||
}
|
||||
elseif ($this->requestStack->getCurrentRequest()->query->has($query_arg)) {
|
||||
$value = $this->requestStack->getCurrentRequest()->query->get($query_arg);
|
||||
if ($value !== '') {
|
||||
return $value;
|
||||
}
|
||||
else {
|
||||
return '?valueless?';
|
||||
}
|
||||
}
|
||||
else {
|
||||
return $this->requestStack->getCurrentRequest()->query->get($query_arg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -477,4 +477,5 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
);
|
||||
return $schema;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,4 +28,5 @@ class ListCacheBinsPass implements CompilerPassInterface {
|
|||
$container->setParameter('cache_bins', $cache_bins);
|
||||
$container->setParameter('cache_default_bin_backends', $cache_default_bin_backends);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\Core\Cache;
|
|||
* many times a cache entry was set or requested.
|
||||
*
|
||||
* @todo On the longrun this backend should be replaced by phpunit mock objects.
|
||||
*
|
||||
*/
|
||||
class MemoryCounterBackend extends MemoryBackend {
|
||||
|
||||
|
@ -49,7 +48,6 @@ class MemoryCounterBackend extends MemoryBackend {
|
|||
*
|
||||
* @param string $function
|
||||
* The called function.
|
||||
*
|
||||
* @param string $cid
|
||||
* The cache ID of the cache entry to increase the counter.
|
||||
*/
|
||||
|
|
|
@ -88,4 +88,5 @@ class NullBackend implements CacheBackendInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeBin() {}
|
||||
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ class PhpBackend implements CacheBackendInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateAll() {
|
||||
foreach($this->storage()->listAll() as $cidhash) {
|
||||
foreach ($this->storage()->listAll() as $cidhash) {
|
||||
$this->invalidatebyHash($cidhash);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,4 +56,5 @@ class BootstrapConfigStorageFactory {
|
|||
public static function getFileStorage() {
|
||||
return new FileStorage(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class ConfigCollectionInfo extends Event {
|
|||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* Exception thrown if $collection is equal to
|
||||
* \Drupal\Core\Config\StorageInterface::DEFAULT_COLLECTION
|
||||
* \Drupal\Core\Config\StorageInterface::DEFAULT_COLLECTION.
|
||||
*/
|
||||
public function addCollection($collection, ConfigFactoryOverrideInterface $override_service = NULL) {
|
||||
if ($collection == StorageInterface::DEFAULT_COLLECTION) {
|
||||
|
|
|
@ -271,7 +271,7 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
|
|||
// Because get() adds overrides both from $GLOBALS and from
|
||||
// $this->configFactoryOverrides, add cache keys for each.
|
||||
$keys[] = 'global_overrides';
|
||||
foreach($this->configFactoryOverrides as $override) {
|
||||
foreach ($this->configFactoryOverrides as $override) {
|
||||
$keys[] = $override->getCacheSuffix();
|
||||
}
|
||||
return $keys;
|
||||
|
|
|
@ -99,4 +99,5 @@ class ConfigModuleOverridesEvent extends Event {
|
|||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -252,7 +252,8 @@ class DatabaseStorage implements StorageInterface {
|
|||
* Implements Drupal\Core\Config\StorageInterface::decode().
|
||||
*
|
||||
* @throws ErrorException
|
||||
* unserialize() triggers E_NOTICE if the string cannot be unserialized.
|
||||
* The unserialize() call will trigger E_NOTICE if the string cannot
|
||||
* be unserialized.
|
||||
*/
|
||||
public function decode($raw) {
|
||||
$data = @unserialize($raw);
|
||||
|
@ -325,5 +326,4 @@ class DatabaseStorage implements StorageInterface {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -121,4 +121,5 @@ trait ConfigDependencyDeleteFormTrait {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ class ConfigDependencyManager {
|
|||
$graph = $this->getGraph();
|
||||
|
||||
foreach ($entities_to_check as $entity) {
|
||||
if (isset($graph[$entity]) && !empty($graph[$entity]['reverse_paths'])){
|
||||
if (isset($graph[$entity]) && !empty($graph[$entity]['reverse_paths'])) {
|
||||
foreach ($graph[$entity]['reverse_paths'] as $dependency => $value) {
|
||||
$dependent_entities[$dependency] = $this->data[$dependency];
|
||||
}
|
||||
|
|
|
@ -127,11 +127,11 @@ class ConfigEntityType extends EntityType implements ConfigEntityTypeInterface {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Drupal\Core\Config\Entity\ConfigEntityStorage.
|
||||
*
|
||||
* @throws \Drupal\Core\Config\Entity\Exception\ConfigEntityStorageClassException
|
||||
* Exception thrown when the provided class is not an instance of
|
||||
* \Drupal\Core\Config\Entity\ConfigEntityStorage.
|
||||
*
|
||||
* @see \Drupal\Core\Config\Entity\ConfigEntityStorage
|
||||
*/
|
||||
protected function checkStorageClass($class) {
|
||||
if (!is_a($class, 'Drupal\Core\Config\Entity\ConfigEntityStorage', TRUE)) {
|
||||
|
|
|
@ -131,4 +131,5 @@ class ExtensionInstallStorage extends InstallStorage {
|
|||
}
|
||||
return $this->folders;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,5 @@ class ConfigSchemaDiscovery implements DiscoveryInterface {
|
|||
}
|
||||
return $definitions;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -133,4 +133,5 @@ trait SchemaCheckTrait {
|
|||
// No errors found.
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -67,10 +67,10 @@ interface StorageComparerInterface {
|
|||
*
|
||||
* Until the changelist has been calculated this will always be FALSE.
|
||||
*
|
||||
* @see \Drupal\Core\Config\StorageComparerInterface::createChangelist().
|
||||
*
|
||||
* @return bool
|
||||
* TRUE if there are changes to process and FALSE if not.
|
||||
*
|
||||
* @see \Drupal\Core\Config\StorageComparerInterface::createChangelist()
|
||||
*/
|
||||
public function hasChanges();
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ class ControllerResolver extends BaseControllerResolver implements ControllerRes
|
|||
*
|
||||
* @param \Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface $http_message_factory
|
||||
* The PSR-7 converter.
|
||||
*
|
||||
* @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver
|
||||
* The class resolver.
|
||||
*/
|
||||
|
|
|
@ -39,8 +39,7 @@ use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
|||
*
|
||||
* @ingroup container
|
||||
*/
|
||||
class CoreServiceProvider implements ServiceProviderInterface {
|
||||
|
||||
class CoreServiceProvider implements ServiceProviderInterface {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -79,7 +79,8 @@ class Connection extends DatabaseConnection {
|
|||
public function query($query, array $args = array(), $options = array()) {
|
||||
try {
|
||||
return parent::query($query, $args, $options);
|
||||
} catch (DatabaseException $e) {
|
||||
}
|
||||
catch (DatabaseException $e) {
|
||||
if ($e->getPrevious()->errorInfo[1] == 1153) {
|
||||
// If a max_allowed_packet error occurs the message length is truncated.
|
||||
// This should prevent the error from recurring if the exception is
|
||||
|
|
|
@ -58,4 +58,5 @@ class Insert extends QueryInsert {
|
|||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -374,7 +374,7 @@ class Connection extends DatabaseConnection {
|
|||
* A string representing the savepoint name. By default,
|
||||
* "mimic_implicit_commit" is used.
|
||||
*
|
||||
* @see Drupal\Core\Database\Connection::pushTransaction().
|
||||
* @see Drupal\Core\Database\Connection::pushTransaction()
|
||||
*/
|
||||
public function addSavepoint($savepoint_name = 'mimic_implicit_commit') {
|
||||
if ($this->inTransaction()) {
|
||||
|
@ -389,7 +389,7 @@ class Connection extends DatabaseConnection {
|
|||
* A string representing the savepoint name. By default,
|
||||
* "mimic_implicit_commit" is used.
|
||||
*
|
||||
* @see Drupal\Core\Database\Connection::popTransaction().
|
||||
* @see Drupal\Core\Database\Connection::popTransaction()
|
||||
*/
|
||||
public function releaseSavepoint($savepoint_name = 'mimic_implicit_commit') {
|
||||
if (isset($this->transactionLayers[$savepoint_name])) {
|
||||
|
|
|
@ -282,4 +282,5 @@ class Tasks extends InstallTasks {
|
|||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -844,6 +844,7 @@ class Schema extends DatabaseSchema {
|
|||
// Modify the hash so it's safe to use in PostgreSQL identifiers.
|
||||
return strtr($hash, array('+' => '_', '/' => '_', '=' => ''));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -152,6 +152,7 @@ class Select extends QuerySelect {
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,4 +25,5 @@ class Truncate extends QueryTruncate {
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ class Connection extends DatabaseConnection {
|
|||
*
|
||||
* @var bool
|
||||
*/
|
||||
var $tableDropped = FALSE;
|
||||
public $tableDropped = FALSE;
|
||||
|
||||
/**
|
||||
* Constructs a \Drupal\Core\Database\Driver\sqlite\Connection object.
|
||||
|
|
|
@ -103,4 +103,5 @@ class Tasks extends InstallTasks {
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,4 +12,5 @@ class Select extends QuerySelect {
|
|||
// SQLite does not support FOR UPDATE so nothing to do.
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -141,4 +141,5 @@ class Statement extends StatementPrefetch implements StatementInterface {
|
|||
|
||||
return $return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,4 +17,5 @@ class Truncate extends QueryTruncate {
|
|||
|
||||
return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,4 +163,5 @@ class Log {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -87,4 +87,5 @@ interface AlterableInterface {
|
|||
* The previously attached metadata object, or NULL if one doesn't exist.
|
||||
*/
|
||||
public function getMetaData($key);
|
||||
|
||||
}
|
||||
|
|
|
@ -351,4 +351,5 @@ class Condition implements ConditionInterface, \Countable {
|
|||
public function orConditionGroup() {
|
||||
return $this->conditionGroupFactory('OR');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -191,4 +191,5 @@ interface ConditionInterface {
|
|||
* @return \Drupal\Core\Database\Query\ConditionInterface
|
||||
*/
|
||||
public function orConditionGroup();
|
||||
|
||||
}
|
||||
|
|
|
@ -75,4 +75,5 @@ class Delete extends Query implements ConditionInterface {
|
|||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,4 +25,5 @@ interface ExtendableInterface {
|
|||
* The extender object, which now contains a reference to this object.
|
||||
*/
|
||||
public function extend($extender_name);
|
||||
|
||||
}
|
||||
|
|
|
@ -170,4 +170,5 @@ class Insert extends Query implements \Countable {
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -403,4 +403,5 @@ class Merge extends Query implements ConditionInterface {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class PagerSelectExtender extends SelectExtender {
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
static $maxElement = 0;
|
||||
public static $maxElement = 0;
|
||||
|
||||
/**
|
||||
* The number of elements per page to allow.
|
||||
|
@ -166,4 +166,5 @@ class PagerSelectExtender extends SelectExtender {
|
|||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ interface PlaceholderInterface {
|
|||
* The next available placeholder ID as an integer.
|
||||
*/
|
||||
public function nextPlaceholder();
|
||||
|
||||
}
|
||||
|
|
|
@ -532,4 +532,5 @@ class SelectExtender implements SelectInterface {
|
|||
public function orConditionGroup() {
|
||||
return $this->conditionGroupFactory('OR');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -96,4 +96,5 @@ class TableSortExtender extends SelectExtender {
|
|||
protected function order() {
|
||||
return tablesort_get_order($this->header);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -80,4 +80,5 @@ class Truncate extends Query {
|
|||
return $comments . 'TRUNCATE {' . $this->connection->escapeTable($this->table) . '} ';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -655,4 +655,5 @@ abstract class Schema implements PlaceholderInterface {
|
|||
}
|
||||
return is_string($value) ? $this->connection->quote($value) : $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -208,4 +208,5 @@ interface StatementInterface extends \Traversable {
|
|||
* An associative array, or an empty array if there is no result set.
|
||||
*/
|
||||
public function fetchAllAssoc($key, $fetch = NULL);
|
||||
|
||||
}
|
||||
|
|
|
@ -93,4 +93,5 @@ class Transaction {
|
|||
$this->rolledBack = TRUE;
|
||||
$this->connection->rollback($this->name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ class DrupalDateTime extends DateTimePlus {
|
|||
|
||||
/**
|
||||
* Format string translation cache.
|
||||
*
|
||||
*/
|
||||
protected $formatTranslationCache;
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ class Datelist extends DateElementBase {
|
|||
$form_state->setError($element, t('The %field date is required.'));
|
||||
}
|
||||
elseif (!empty($all_empty)) {
|
||||
foreach ($all_empty as $value){
|
||||
foreach ($all_empty as $value) {
|
||||
$form_state->setError($element[$value], t('A value must be selected for %part.', array('%part' => $value)));
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +357,6 @@ class Datelist extends DateElementBase {
|
|||
* Rounds minutes and seconds to nearest requested value.
|
||||
*
|
||||
* @param $date
|
||||
*
|
||||
* @param $increment
|
||||
*
|
||||
* @return
|
||||
|
|
|
@ -29,4 +29,5 @@ class Container extends DrupalContainer {
|
|||
assert(FALSE, 'The container was serialized.');
|
||||
return array_keys(get_object_vars($this));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,4 +24,5 @@ interface ContainerInjectionInterface {
|
|||
* The service container this instance should use.
|
||||
*/
|
||||
public static function create(ContainerInterface $container);
|
||||
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ class YamlFileLoader
|
|||
/**
|
||||
* Loads a Yaml file.
|
||||
*
|
||||
* @param mixed $file The resource
|
||||
* @param mixed $file
|
||||
* The resource
|
||||
*/
|
||||
public function load($file)
|
||||
{
|
||||
|
@ -99,7 +100,7 @@ class YamlFileLoader
|
|||
/**
|
||||
* Parses definitions
|
||||
*
|
||||
* @param array $content
|
||||
* @param array $content
|
||||
* @param string $file
|
||||
*/
|
||||
private function parseDefinitions($content, $file)
|
||||
|
@ -121,10 +122,11 @@ class YamlFileLoader
|
|||
* Parses a definition.
|
||||
*
|
||||
* @param string $id
|
||||
* @param array $service
|
||||
* @param array $service
|
||||
* @param string $file
|
||||
*
|
||||
* @throws InvalidArgumentException When tags are invalid
|
||||
* @throws InvalidArgumentException
|
||||
* When tags are invalid.
|
||||
*/
|
||||
private function parseDefinition($id, $service, $file)
|
||||
{
|
||||
|
@ -318,7 +320,8 @@ class YamlFileLoader
|
|||
*
|
||||
* @return array The file content
|
||||
*
|
||||
* @throws InvalidArgumentException when the given file is not a local file or when it does not exist
|
||||
* @throws InvalidArgumentException
|
||||
* When the given file is not a local file or when it does not exist.
|
||||
*/
|
||||
protected function loadFile($file)
|
||||
{
|
||||
|
@ -336,12 +339,13 @@ class YamlFileLoader
|
|||
/**
|
||||
* Validates a YAML file.
|
||||
*
|
||||
* @param mixed $content
|
||||
* @param mixed $content
|
||||
* @param string $file
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws InvalidArgumentException When service file is not valid
|
||||
* @throws InvalidArgumentException
|
||||
* When service file is not valid.
|
||||
*/
|
||||
private function validate($content, $file)
|
||||
{
|
||||
|
|
|
@ -18,4 +18,5 @@ interface DestructableInterface {
|
|||
* Performs destruct operations.
|
||||
*/
|
||||
public function destruct();
|
||||
|
||||
}
|
||||
|
|
|
@ -211,4 +211,5 @@ class DiffFormatter extends DiffFormatterBase {
|
|||
$this->rows[] = array_merge($this->emptyLine(), $this->addedLine($line));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -974,11 +974,9 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
|
|||
|
||||
// If the class loader is still the same, possibly upgrade to the APC class
|
||||
// loader.
|
||||
// ApcClassLoader does not support APCu without backwards compatibility
|
||||
// enabled.
|
||||
if ($class_loader_class == get_class($this->classLoader)
|
||||
&& Settings::get('class_loader_auto_detect', TRUE)
|
||||
&& extension_loaded('apc')) {
|
||||
&& function_exists('apcu_fetch')) {
|
||||
$prefix = Settings::getApcuPrefix('class_loader', $this->root);
|
||||
$apc_loader = new ApcClassLoader($prefix, $this->classLoader);
|
||||
$this->classLoader->unregister();
|
||||
|
@ -1474,4 +1472,5 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
|
|||
protected function addServiceFiles(array $service_yamls) {
|
||||
$this->serviceYamls['site'] = array_filter($service_yamls, 'file_exists');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Drupal\Core\Entity\ContentEntityStorageInterface.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* If the provided class does not implement
|
||||
* \Drupal\Core\Entity\ContentEntityStorageInterface.
|
||||
*
|
||||
* @see \Drupal\Core\Entity\ContentEntityStorageInterface
|
||||
*/
|
||||
protected function checkStorageClass($class) {
|
||||
$required_interface = ContentEntityStorageInterface::class;
|
||||
|
|
|
@ -57,19 +57,33 @@ class EntityAutocomplete extends Textfield {
|
|||
if (is_array($element['#default_value']) && $element['#tags'] !== TRUE) {
|
||||
throw new \InvalidArgumentException('The #default_value property is an array but the form element does not allow multiple values.');
|
||||
}
|
||||
elseif (!is_array($element['#default_value'])) {
|
||||
elseif (!empty($element['#default_value']) && !is_array($element['#default_value'])) {
|
||||
// Convert the default value into an array for easier processing in
|
||||
// static::getEntityLabels().
|
||||
$element['#default_value'] = array($element['#default_value']);
|
||||
}
|
||||
|
||||
if ($element['#default_value'] && !(reset($element['#default_value']) instanceof EntityInterface)) {
|
||||
throw new \InvalidArgumentException('The #default_value property has to be an entity object or an array of entity objects.');
|
||||
}
|
||||
if ($element['#default_value']) {
|
||||
if (!(reset($element['#default_value']) instanceof EntityInterface)) {
|
||||
throw new \InvalidArgumentException('The #default_value property has to be an entity object or an array of entity objects.');
|
||||
}
|
||||
|
||||
// Extract the labels from the passed-in entity objects, taking access
|
||||
// checks into account.
|
||||
return static::getEntityLabels($element['#default_value']);
|
||||
// Extract the labels from the passed-in entity objects, taking access
|
||||
// checks into account.
|
||||
return static::getEntityLabels($element['#default_value']);
|
||||
}
|
||||
}
|
||||
|
||||
// Potentially the #value is set directly, so it contains the 'target_id'
|
||||
// array structure instead of a string.
|
||||
if ($input !== FALSE && is_array($input)) {
|
||||
$entity_ids = array_map(function(array $item) {
|
||||
return $item['target_id'];
|
||||
}, $input);
|
||||
|
||||
$entities = \Drupal::entityTypeManager()->getStorage($element['#target_type'])->loadMultiple($entity_ids);
|
||||
|
||||
return static::getEntityLabels($entities);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,6 +150,7 @@ class EntityAutocomplete extends Textfield {
|
|||
*/
|
||||
public static function validateEntityAutocomplete(array &$element, FormStateInterface $form_state, array &$complete_form) {
|
||||
$value = NULL;
|
||||
|
||||
if (!empty($element['#value'])) {
|
||||
$options = array(
|
||||
'target_type' => $element['#target_type'],
|
||||
|
@ -146,27 +161,35 @@ class EntityAutocomplete extends Textfield {
|
|||
$handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance($options);
|
||||
$autocreate = (bool) $element['#autocreate'] && $handler instanceof SelectionWithAutocreateInterface;
|
||||
|
||||
$input_values = $element['#tags'] ? Tags::explode($element['#value']) : array($element['#value']);
|
||||
foreach ($input_values as $input) {
|
||||
$match = static::extractEntityIdFromAutocompleteInput($input);
|
||||
if ($match === NULL) {
|
||||
// Try to get a match from the input string when the user didn't use
|
||||
// the autocomplete but filled in a value manually.
|
||||
$match = static::matchEntityByTitle($handler, $input, $element, $form_state, !$autocreate);
|
||||
}
|
||||
// GET forms might pass the validated data around on the next request, in
|
||||
// which case it will already be in the expected format.
|
||||
if (is_array($element['#value'])) {
|
||||
$value = $element['#value'];
|
||||
}
|
||||
else {
|
||||
$input_values = $element['#tags'] ? Tags::explode($element['#value']) : array($element['#value']);
|
||||
|
||||
if ($match !== NULL) {
|
||||
$value[] = array(
|
||||
'target_id' => $match,
|
||||
);
|
||||
}
|
||||
elseif ($autocreate) {
|
||||
/** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface $handler */
|
||||
// Auto-create item. See an example of how this is handled in
|
||||
// \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::presave().
|
||||
$value[] = array(
|
||||
'entity' => $handler->createNewEntity($element['#target_type'], $element['#autocreate']['bundle'], $input, $element['#autocreate']['uid']),
|
||||
);
|
||||
foreach ($input_values as $input) {
|
||||
$match = static::extractEntityIdFromAutocompleteInput($input);
|
||||
if ($match === NULL) {
|
||||
// Try to get a match from the input string when the user didn't use
|
||||
// the autocomplete but filled in a value manually.
|
||||
$match = static::matchEntityByTitle($handler, $input, $element, $form_state, !$autocreate);
|
||||
}
|
||||
|
||||
if ($match !== NULL) {
|
||||
$value[] = array(
|
||||
'target_id' => $match,
|
||||
);
|
||||
}
|
||||
elseif ($autocreate) {
|
||||
/** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface $handler */
|
||||
// Auto-create item. See an example of how this is handled in
|
||||
// \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::presave().
|
||||
$value[] = array(
|
||||
'entity' => $handler->createNewEntity($element['#target_type'], $element['#autocreate']['bundle'], $input, $element['#autocreate']['uid']),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -301,4 +301,5 @@ class EntityViewDisplay extends EntityDisplayBase implements EntityViewDisplayIn
|
|||
'formatters' => new EntityDisplayPluginCollection($this->pluginManager, $configurations)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,5 @@ interface EntityChangedInterface {
|
|||
* translations.
|
||||
*/
|
||||
public function getChangedTimeAcrossTranslations();
|
||||
|
||||
}
|
||||
|
|
|
@ -45,4 +45,5 @@ trait EntityChangedTrait {
|
|||
$this->set('changed', $timestamp);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,4 +26,5 @@ interface EntityDisplayModeInterface extends ConfigEntityInterface {
|
|||
* @return $this
|
||||
*/
|
||||
public function setTargetType($target_entity_type);
|
||||
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ abstract class EntityStorageBase extends EntityHandlerBase implements EntityStor
|
|||
* @param string $hook
|
||||
* One of 'presave', 'insert', 'update', 'predelete', 'delete', or
|
||||
* 'revision_delete'.
|
||||
* @param \Drupal\Core\Entity\EntityInterface $entity
|
||||
* @param \Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object.
|
||||
*/
|
||||
protected function invokeHook($hook, EntityInterface $entity) {
|
||||
|
|
|
@ -28,7 +28,6 @@ class QueryFactory implements QueryFactoryInterface {
|
|||
|
||||
/**
|
||||
* Constructs a QueryFactory object.
|
||||
*
|
||||
*/
|
||||
public function __construct(KeyValueFactoryInterface $key_value_factory) {
|
||||
$this->keyValueFactory = $key_value_factory;
|
||||
|
|
|
@ -93,4 +93,5 @@ class EntityDeriver implements ContainerDeriverInterface {
|
|||
}
|
||||
return $this->derivatives;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -121,4 +121,5 @@ class EntityReference extends DataReferenceBase {
|
|||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,4 +55,5 @@ class BundleConstraint extends Constraint {
|
|||
public function getRequiredOptions() {
|
||||
return array('bundle');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,4 +16,5 @@ use Symfony\Component\Validator\Constraint;
|
|||
class EntityChangedConstraint extends Constraint {
|
||||
|
||||
public $message = 'The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.';
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,5 @@ class EntityTypeConstraint extends Constraint {
|
|||
public function getRequiredOptions() {
|
||||
return array('type');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,4 +47,5 @@ class ReferenceAccessConstraintValidator extends ConstraintValidator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,4 +20,5 @@ abstract class ConditionBase extends ConditionFundamentals implements ConditionI
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,4 +72,5 @@ interface ConditionInterface {
|
|||
* The query object this conditional clause belongs to.
|
||||
*/
|
||||
public function compile($query);
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,5 @@ class Query extends QueryBase implements QueryInterface, QueryAggregateInterface
|
|||
public function conditionAggregateGroupFactory($conjunction = 'AND') {
|
||||
return new ConditionAggregate($conjunction, $this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ interface QueryAggregateInterface extends QueryInterface {
|
|||
* The aggregation function, for example COUNT or MIN.
|
||||
* @param mixed $value
|
||||
* The actual value of the field.
|
||||
*
|
||||
* @param $operator
|
||||
* Possible values:
|
||||
* - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS',
|
||||
|
@ -58,14 +57,13 @@ interface QueryAggregateInterface extends QueryInterface {
|
|||
* literals of the same type as the column.
|
||||
* - 'BETWEEN': This operator expects $value to be an array of two literals
|
||||
* of the same type as the column.
|
||||
*
|
||||
* @param string $langcode
|
||||
* (optional) The language code.
|
||||
*
|
||||
* @return \Drupal\Core\Entity\Query\QueryAggregateInterface
|
||||
* The called object.
|
||||
*
|
||||
* @see \Drupal\Core\Entity\Query\QueryInterface::condition().
|
||||
* @see \Drupal\Core\Entity\Query\QueryInterface::condition()
|
||||
*/
|
||||
public function conditionAggregate($field, $function = NULL, $value = NULL, $operator = '=', $langcode = NULL);
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ abstract class QueryBase implements QueryInterface {
|
|||
* The alias for the field.
|
||||
*/
|
||||
protected function getAggregationAlias($field, $function) {
|
||||
return strtolower($field . '_'. $function);
|
||||
return strtolower($field . '_' . $function);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -118,7 +118,7 @@ class QueryAggregate extends Query implements QueryAggregateInterface {
|
|||
* Returns the called object.
|
||||
*/
|
||||
protected function addSortAggregate() {
|
||||
if(!$this->count) {
|
||||
if (!$this->count) {
|
||||
foreach ($this->sortAggregate as $alias => $sort) {
|
||||
$this->sqlQuery->orderBy($alias, $sort['direction']);
|
||||
}
|
||||
|
|
|
@ -33,4 +33,5 @@ class Condition extends BaseCondition {
|
|||
}
|
||||
parent::translateCondition($condition, $sql_query, $case_sensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ class DefaultTableMapping implements TableMappingInterface {
|
|||
public function getColumnNames($field_name) {
|
||||
if (!isset($this->columnMapping[$field_name])) {
|
||||
$this->columnMapping[$field_name] = array();
|
||||
if (isset($this->fieldStorageDefinitions[$field_name])) {
|
||||
if (isset($this->fieldStorageDefinitions[$field_name]) && !$this->fieldStorageDefinitions[$field_name]->hasCustomStorage()) {
|
||||
foreach (array_keys($this->fieldStorageDefinitions[$field_name]->getColumns()) as $property_name) {
|
||||
$this->columnMapping[$field_name][$property_name] = $this->getFieldColumnName($this->fieldStorageDefinitions[$field_name], $property_name);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
*
|
||||
* @ingroup entity_api
|
||||
*/
|
||||
class SqlContentEntityStorage extends ContentEntityStorageBase implements SqlEntityStorageInterface, DynamicallyFieldableEntityStorageSchemaInterface, EntityBundleListenerInterface {
|
||||
class SqlContentEntityStorage extends ContentEntityStorageBase implements SqlEntityStorageInterface, DynamicallyFieldableEntityStorageSchemaInterface, EntityBundleListenerInterface {
|
||||
|
||||
/**
|
||||
* The mapping of field columns to SQL tables.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue