Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -2,7 +2,7 @@
|
|||
* @file
|
||||
* Attaches behaviors for the Path module.
|
||||
*/
|
||||
(function ($) {
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -26,4 +26,4 @@
|
|||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery, Drupal);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityTypeInterface;
|
||||
use Drupal\Core\Field\FieldDefinition;
|
||||
use Drupal\Core\Field\BaseFieldDefinition;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Controller\PathController.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Controller;
|
||||
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Form\AddForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Form;
|
||||
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Form\DeleteForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Form;
|
||||
|
||||
use Drupal\Core\Form\ConfirmFormBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Form\EditForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Form;
|
||||
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
@ -40,28 +35,25 @@ class EditForm extends PathFormBase {
|
|||
'#type' => 'hidden',
|
||||
'#value' => $this->path['pid'],
|
||||
);
|
||||
$form['actions']['delete'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => $this->t('Delete'),
|
||||
'#submit' => array('::deleteSubmit'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the delete form.
|
||||
*/
|
||||
public function deleteSubmit(array &$form, FormStateInterface $form_state) {
|
||||
$url = new Url('path.delete', array(
|
||||
'pid' => $form_state->getValue('pid'),
|
||||
'pid' => $this->path['pid'],
|
||||
));
|
||||
|
||||
if ($this->getRequest()->query->has('destination')) {
|
||||
$url->setOption('query', $this->getDestinationArray());
|
||||
$this->getRequest()->query->remove('destination');
|
||||
}
|
||||
|
||||
$form_state->setRedirectUrl($url);
|
||||
$form['actions']['delete'] = array(
|
||||
'#type' => 'link',
|
||||
'#title' => $this->t('Delete'),
|
||||
'#url' => $url,
|
||||
'#attributes' => array(
|
||||
'class' => array('button', 'button--danger'),
|
||||
),
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Form\PathFilterForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Form;
|
||||
|
||||
use Drupal\Core\Form\FormBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Form\PathFormBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Form;
|
||||
|
||||
use Drupal\Core\Form\FormBase;
|
||||
|
@ -116,7 +111,7 @@ abstract class PathFormBase extends FormBase {
|
|||
'#default_value' => $this->path['alias'],
|
||||
'#maxlength' => 255,
|
||||
'#size' => 45,
|
||||
'#description' => $this->t('Specify an alternative path by which this data can be accessed. For example, type "/about" when writing an about page. Use a relative path with a slash in front..'),
|
||||
'#description' => $this->t('Specify an alternative path by which this data can be accessed. For example, type "/about" when writing an about page. Use a relative path with a slash in front.'),
|
||||
'#field_prefix' => $this->requestContext->getCompleteBaseUrl(),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
@ -151,6 +146,7 @@ abstract class PathFormBase extends FormBase {
|
|||
$form['actions']['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => $this->t('Save'),
|
||||
'#button_type' => 'primary',
|
||||
);
|
||||
|
||||
return $form;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\Field\FieldType\PathFieldItemList.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\Field\FieldType;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\Field\FieldType\PathItem.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\Field\FieldType;
|
||||
|
||||
use Drupal\Component\Utility\Random;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\Field\FieldWidget\PathWidget.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\Field\FieldWidget;
|
||||
|
||||
use Drupal\Core\Field\FieldItemListInterface;
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\migrate\destination\UrlAlias.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\migrate\destination;
|
||||
|
||||
use Drupal\Core\Path\AliasStorage;
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate\Row;
|
||||
use Drupal\migrate\Plugin\migrate\destination\DestinationBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
@ -37,7 +32,7 @@ class UrlAlias extends DestinationBase implements ContainerFactoryPluginInterfac
|
|||
* The plugin_id for the plugin instance.
|
||||
* @param mixed $plugin_definition
|
||||
* The plugin implementation definition.
|
||||
* @param MigrationInterface $migration
|
||||
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
||||
* The migration.
|
||||
* @param \Drupal\Core\Path\AliasStorage $alias_storage
|
||||
* The alias storage service.
|
||||
|
@ -90,8 +85,8 @@ class UrlAlias extends DestinationBase implements ContainerFactoryPluginInterfac
|
|||
return [
|
||||
'pid' => 'The path id',
|
||||
'source' => 'The source path.',
|
||||
'alias' => 'The url alias.',
|
||||
'langcode' => 'The language code for the url.',
|
||||
'alias' => 'The URL alias.',
|
||||
'langcode' => 'The language code for the URL.',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\migrate\process\d6\UrlAliasLanguage.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\migrate\process\d6;
|
||||
|
||||
use Drupal\migrate\MigrateExecutableInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\migrate\source\UrlAliasBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\migrate\source;
|
||||
|
||||
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
||||
|
@ -27,7 +22,7 @@ abstract class UrlAliasBase extends DrupalSqlBase {
|
|||
public function fields() {
|
||||
return array(
|
||||
'pid' => $this->t('The numeric identifier of the path alias.'),
|
||||
'language' => $this->t('The language code of the url alias.'),
|
||||
'language' => $this->t('The language code of the URL alias.'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\migrate\source\d6\UrlAlias.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\path\Plugin\migrate\source\UrlAliasBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Plugin\migrate\source\d7\UrlAlias.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\path\Plugin\migrate\source\UrlAliasBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathAdminTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathAliasTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
|
@ -145,7 +140,9 @@ class PathAliasTest extends PathTestBase {
|
|||
]), 'Attempt to move upper-case alias was rejected.');
|
||||
|
||||
// Delete alias.
|
||||
$this->drupalPostForm('admin/config/search/path/edit/' . $pid, array(), t('Delete'));
|
||||
$this->drupalGet('admin/config/search/path/edit/' . $pid);
|
||||
$this->clickLink(t('Delete'));
|
||||
$this->assertRaw(t('Are you sure you want to delete path alias %name?', array('%name' => $edit['alias'])));
|
||||
$this->drupalPostForm(NULL, array(), t('Confirm'));
|
||||
|
||||
// Confirm that the alias no longer works.
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathLanguageTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathLanguageUiTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathNodeFormTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathTaxonomyTermTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
use Drupal\taxonomy\Entity\Vocabulary;
|
||||
|
@ -27,10 +22,10 @@ class PathTaxonomyTermTest extends PathTestBase {
|
|||
parent::setUp();
|
||||
|
||||
// Create a Tags vocabulary for the Article node type.
|
||||
$vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
$vocabulary = Vocabulary::create([
|
||||
'name' => t('Tags'),
|
||||
'vid' => 'tags',
|
||||
));
|
||||
]);
|
||||
$vocabulary->save();
|
||||
|
||||
// Create and login user.
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\PathTestBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\path\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\Migrate\d6\MigrateUrlAliasTest.
|
||||
*/
|
||||
namespace Drupal\Tests\path\Kernel\Migrate\d6;
|
||||
|
||||
namespace Drupal\path\Tests\Migrate\d6;
|
||||
|
||||
use Drupal\migrate\Entity\Migration;
|
||||
use Drupal\migrate\Plugin\MigrateIdMapInterface;
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* URL alias migration.
|
||||
|
@ -29,7 +23,6 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->installSchema('system', ['url_alias']);
|
||||
$this->executeMigration('d6_url_alias');
|
||||
}
|
||||
|
||||
|
@ -54,7 +47,8 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
|
|||
* Test the url alias migration.
|
||||
*/
|
||||
public function testUrlAlias() {
|
||||
$id_map = Migration::load('d6_url_alias')->getIdMap();
|
||||
$id_map = $this->getMigration('d6_url_alias')->getIdMap();
|
||||
// Test that the field exists.
|
||||
$conditions = array(
|
||||
'source' => '/node/1',
|
||||
'alias' => '/alias-one',
|
||||
|
@ -83,9 +77,7 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
|
|||
->update($id_map->mapTableName())
|
||||
->fields(array('source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE))
|
||||
->execute();
|
||||
$migration = \Drupal::entityManager()
|
||||
->getStorage('migration')
|
||||
->loadUnchanged('d6_url_alias');
|
||||
$migration = $this->getMigration('d6_url_alias');
|
||||
$this->executeMigration($migration);
|
||||
|
||||
$path = \Drupal::service('path.alias_storage')->load(array('pid' => $path['pid']));
|
|
@ -1,13 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\Tests\Migrate\d7\MigrateUrlAliasTest.
|
||||
*/
|
||||
namespace Drupal\Tests\path\Kernel\Migrate\d7;
|
||||
|
||||
namespace Drupal\path\Tests\Migrate\d7;
|
||||
|
||||
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||
|
||||
/**
|
||||
* Tests URL alias migration.
|
||||
|
@ -26,7 +21,6 @@ class MigrateUrlAliasTest extends MigrateDrupal7TestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->installSchema('system', ['url_alias']);
|
||||
$this->executeMigration('d7_url_alias');
|
||||
}
|
||||
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\path\tests\Kernel\PathNoCanonicalLinkTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\path\Kernel;
|
||||
|
||||
use Drupal\content_translation_test\Entity\EntityTestTranslatableUISkip;
|
||||
|
@ -30,7 +25,6 @@ class PathNoCanonicalLinkTest extends KernelTestBase {
|
|||
|
||||
$this->installEntitySchema('entity_test');
|
||||
$this->installEntitySchema('entity_test_mul');
|
||||
$this->installSchema('system', 'router');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Adding german language.
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\path\Unit\Field\PathFieldDefinitionTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Field;
|
||||
|
||||
use Drupal\Tests\Core\Field\BaseFieldDefinitionTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\path\Unit\Migrate\UrlAliasTestBase.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\path\Unit\Migrate\d6\UrlAliasTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate\d6;
|
||||
|
||||
use Drupal\Tests\path\Unit\Migrate\UrlAliasTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\path\Unit\Migrate\d7\UrlAliasTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\path\Unit\Migrate\d7;
|
||||
|
||||
use Drupal\Tests\path\Unit\Migrate\UrlAliasTestBase;
|
||||
|
|
Reference in a new issue