Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668
This commit is contained in:
parent
f32e58e4b1
commit
8e18df8c36
3062 changed files with 15044 additions and 172506 deletions
|
@ -5,7 +5,7 @@
|
|||
|
||||
(function ($) {
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Behaviors for setting summaries on content type form.
|
||||
|
@ -26,7 +26,7 @@
|
|||
});
|
||||
$context.find('#edit-workflow').drupalSetSummary(function (context) {
|
||||
var vals = [];
|
||||
$(context).find("input[name^='options']:checked").parent().each(function () {
|
||||
$(context).find('input[name^="options"]:checked').parent().each(function () {
|
||||
vals.push(Drupal.checkPlain($(this).text()));
|
||||
});
|
||||
if (!$(context).find('#edit-options-status').is(':checked')) {
|
||||
|
@ -37,7 +37,7 @@
|
|||
$('#edit-language', context).drupalSetSummary(function (context) {
|
||||
var vals = [];
|
||||
|
||||
vals.push($(".js-form-item-language-configuration-langcode select option:selected", context).text());
|
||||
vals.push($('.js-form-item-language-configuration-langcode select option:selected', context).text());
|
||||
|
||||
$('input:checked', context).next('label').each(function () {
|
||||
vals.push(Drupal.checkPlain($(this).text()));
|
||||
|
|
|
@ -39,6 +39,3 @@ process:
|
|||
|
||||
destination:
|
||||
plugin: entity_revision:node
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d6_node:*
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* Content administration and module settings user interface.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Language\Language;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\node\Entity\Node;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
(function ($, Drupal, drupalSettings) {
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Behaviors for tabs in the node edit form.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
* API pattern.
|
||||
*/
|
||||
|
||||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Component\Utility\Xss;
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
|
@ -317,7 +316,8 @@ function node_type_load($name) {
|
|||
* @param string $label
|
||||
* (optional) The label for the body instance.
|
||||
*
|
||||
* @return \Drupal\field\Entity\FieldConfig Body field.
|
||||
* @return \Drupal\field\Entity\FieldConfig
|
||||
* A Body field object.
|
||||
*/
|
||||
function node_add_body_field(NodeTypeInterface $type, $label = 'Body') {
|
||||
// Add or remove the body field, as needed.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
(function ($, Drupal) {
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Disables all non-relevant links in node previews.
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
* Provide views data for node.module.
|
||||
*/
|
||||
|
||||
use Drupal\views\Analyzer;
|
||||
use Drupal\views\ViewExecutable;
|
||||
|
||||
/**
|
||||
* Implements hook_views_wizard().
|
||||
*/
|
||||
|
|
|
@ -47,8 +47,6 @@ class NodeRevisionAccessCheck implements AccessInterface {
|
|||
*
|
||||
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
|
||||
* The entity manager.
|
||||
* @param \Drupal\Core\Database\Connection $connection
|
||||
* The database connection.
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $entity_manager) {
|
||||
$this->nodeStorage = $entity_manager->getStorage('node');
|
||||
|
|
|
@ -23,7 +23,10 @@ class NodeTypeMapper extends ConfigEntityMapper {
|
|||
|
||||
// Adds the title label to the translation form.
|
||||
$node_type = $entity->id();
|
||||
$this->addConfigName("core.base_field_override.node.$node_type.title");
|
||||
$config = $this->configFactory->get("core.base_field_override.node.$node_type.title");
|
||||
if (!$config->isNew()) {
|
||||
$this->addConfigName($config->getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\node\Controller;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\Controller\EntityViewController;
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ use Drupal\Core\Entity\EntityChangedTrait;
|
|||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
use Drupal\Core\Entity\EntityTypeInterface;
|
||||
use Drupal\Core\Field\BaseFieldDefinition;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\user\UserInterface;
|
||||
|
|
|
@ -12,7 +12,6 @@ use Drupal\Core\Entity\EntityStorageInterface;
|
|||
use Drupal\Core\Form\ConfirmFormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,6 @@ use Drupal\Core\Entity\EntityHandlerInterface;
|
|||
use Drupal\Core\Entity\EntityTypeInterface;
|
||||
use Drupal\Core\Field\FieldDefinitionInterface;
|
||||
use Drupal\Core\Field\FieldItemListInterface;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\Core\Entity\EntityAccessControlHandler;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Drupal\node;
|
|||
use Drupal\Core\Entity\ContentEntityForm;
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\user\Entity\User;
|
||||
use Drupal\user\PrivateTempStoreFactory;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
|
|
|
@ -11,12 +11,9 @@ use Drupal\Core\Access\AccessResult;
|
|||
use Drupal\Core\Database\Connection;
|
||||
use Drupal\Core\Database\Query\SelectInterface;
|
||||
use Drupal\Core\Database\Query\Condition;
|
||||
use Drupal\Core\Entity\ContentEntityBase;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\user\Entity\User;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Defines a controller class that handles the node grants system.
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Drupal\node;
|
|||
use Drupal\user\EntityOwnerInterface;
|
||||
use Drupal\Core\Entity\EntityChangedInterface;
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
use Drupal\user\UserInterface;
|
||||
|
||||
/**
|
||||
* Provides an interface defining a node entity.
|
||||
|
|
|
@ -11,7 +11,6 @@ use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
|
|||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityViewBuilder;
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\user\Entity\User;
|
||||
|
||||
/**
|
||||
* Render controller for nodes.
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\node\ParamConverter;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\user\PrivateTempStoreFactory;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Drupal\Core\ParamConverter\ParamConverterInterface;
|
||||
|
|
|
@ -9,8 +9,6 @@ namespace Drupal\node\Plugin\Block;
|
|||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -97,7 +97,7 @@ class NodeSearch extends ConfigurableSearchPluginBase implements AccessibleInter
|
|||
/**
|
||||
* The list of options and info for advanced search filters.
|
||||
*
|
||||
* Each entry in the array has the option as the key and and for its value, an
|
||||
* Each entry in the array has the option as the key and for its value, an
|
||||
* array that determines how the value is matched in the database query. The
|
||||
* possible keys in that array are:
|
||||
* - column: (required) Name of the database column to match against.
|
||||
|
|
|
@ -41,9 +41,17 @@ class Node extends CckBuilder {
|
|||
$node_type = $row->getSourceProperty('type');
|
||||
$values = $template;
|
||||
$values['id'] = $template['id'] . '__' . $node_type;
|
||||
|
||||
$label = $template['label'];
|
||||
$values['label'] = $this->t("@label (@type)", ['@label' => $label, '@type' => $node_type]);
|
||||
$values['source']['node_type'] = $node_type;
|
||||
|
||||
// If this migration is based on the d6_node_revision template, it should
|
||||
// explicitly depend on the corresponding d6_node variant.
|
||||
if ($template['id'] == 'd6_node_revision') {
|
||||
$values['migration_dependencies']['required'][] = 'd6_node__' . $node_type;
|
||||
}
|
||||
|
||||
$migration = Migration::create($values);
|
||||
|
||||
if (isset($fields[$node_type])) {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\node\Plugin\views\field;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\system\Plugin\views\field\BulkForm;
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,8 +9,6 @@ namespace Drupal\node\Plugin\views\row;
|
|||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\views\Plugin\views\row\RssPluginBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\node\NodeStorageInterface;
|
||||
|
||||
/**
|
||||
* Plugin which performs a node_view on the resulting object
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace Drupal\node\Tests\Migrate\d6;
|
||||
|
||||
use Drupal\migrate\Entity\Migration;
|
||||
|
||||
/**
|
||||
* Node content revisions migration.
|
||||
*
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\node\Tests\Migrate\d6;
|
||||
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\user\Entity\User;
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
|
|||
*/
|
||||
public function testNode() {
|
||||
$this->assertEntity(1, 'test_content_type', 'en', 'A Node', '2', TRUE, '1421727515', '1441032132', TRUE, FALSE);
|
||||
$this->assertRevision(1, 'A Node', '2', NULL, '1441032132');
|
||||
$this->assertRevision(1, 'A Node', '1', NULL, '1441032132');
|
||||
|
||||
$node = Node::load(1);
|
||||
$this->assertTrue($node->field_boolean->value);
|
||||
|
|
|
@ -7,13 +7,10 @@
|
|||
|
||||
namespace Drupal\node\Tests;
|
||||
|
||||
use Drupal\Core\Field\Entity\BaseFieldOverride;
|
||||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\node\Entity\NodeType;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
use Drupal\system\Tests\Entity\EntityUnitTestBase;
|
||||
|
||||
/**
|
||||
* Tests node body field storage.
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\node\Tests;
|
|||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase;
|
||||
use Drupal\user\Entity\Role;
|
||||
|
||||
/**
|
||||
* Tests the Node entity's cache tags.
|
||||
|
|
|
@ -28,12 +28,19 @@ class NodeTypeTranslationTest extends WebTestBase {
|
|||
'node',
|
||||
);
|
||||
|
||||
/**
|
||||
* The default language code to use in this test.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultLangcode = 'fr';
|
||||
|
||||
/**
|
||||
* Languages to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $langcodes = array('fr');
|
||||
protected $additionalLangcodes = ['es'];
|
||||
|
||||
/**
|
||||
* Administrator user for tests.
|
||||
|
@ -56,11 +63,26 @@ class NodeTypeTranslationTest extends WebTestBase {
|
|||
$this->adminUser = $this->drupalCreateUser($admin_permissions);
|
||||
|
||||
// Add languages.
|
||||
foreach ($this->langcodes as $langcode) {
|
||||
foreach ($this->additionalLangcodes as $langcode) {
|
||||
ConfigurableLanguage::createFromLangcode($langcode)->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* Install Drupal in a language other than English for this test. This is not
|
||||
* needed to test the node type translation itself but acts as a regression
|
||||
* test.
|
||||
*
|
||||
* @see https://www.drupal.org/node/2584603
|
||||
*/
|
||||
protected function installParameters() {
|
||||
$parameters = parent::installParameters();
|
||||
$parameters['parameters']['langcode'] = $this->defaultLangcode;
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the node type translation.
|
||||
*/
|
||||
|
@ -71,14 +93,13 @@ class NodeTypeTranslationTest extends WebTestBase {
|
|||
$this->drupalCreateContentType(array('type' => $type, 'name' => $name));
|
||||
|
||||
// Translate the node type name.
|
||||
$langcode = $this->langcodes[0];
|
||||
$langcode = $this->additionalLangcodes[0];
|
||||
$translated_name = $langcode . '-' . $name;
|
||||
$edit = array(
|
||||
"translation[config_names][node.type.$type][name]" => $translated_name,
|
||||
);
|
||||
|
||||
// Edit the title label to avoid having an exception when we save the translation.
|
||||
$this->drupalPostForm("admin/structure/types/manage/$type", array('title_label' => 'Edited title'), t('Save content type'));
|
||||
$this->drupalPostForm("admin/structure/types/manage/$type/translate/$langcode/add", $edit, t('Save translation'));
|
||||
|
||||
// Check the name is translated without admin theme for editing.
|
||||
|
@ -100,7 +121,7 @@ class NodeTypeTranslationTest extends WebTestBase {
|
|||
$name = $this->randomString();
|
||||
$this->drupalLogin($this->adminUser);
|
||||
$this->drupalCreateContentType(array('type' => $type, 'name' => $name));
|
||||
$langcode = $this->langcodes[0];
|
||||
$langcode = $this->additionalLangcodes[0];
|
||||
|
||||
// Edit the title label for it to be displayed on the translation form.
|
||||
$this->drupalPostForm("admin/structure/types/manage/$type", array('title_label' => 'Edited title'), t('Save content type'));
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
|
||||
namespace Drupal\node\Tests\Views;
|
||||
|
||||
use Drupal\views\Views;
|
||||
use Drupal\node\Tests\Views\NodeTestBase;
|
||||
|
||||
/**
|
||||
* Tests replacement of Views tokens supplied by the Node module.
|
||||
*
|
||||
|
|
Reference in a new issue