updated core from 8.4 to 8.5 : bug with login_destination
This commit is contained in:
@@ -6,8 +6,8 @@ package: Core
|
||||
# core: 8.x
|
||||
configure: block.admin_display
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457826
|
||||
|
||||
@@ -30,6 +30,3 @@ block.block.*:
|
||||
sequence:
|
||||
type: condition.plugin.[id]
|
||||
label: 'Visibility Condition'
|
||||
|
||||
block.settings.*:
|
||||
type: block_settings
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
attach(context, settings) {
|
||||
const $input = $('input.block-filter-text').once('block-filter-text');
|
||||
const $table = $($input.attr('data-element'));
|
||||
let $filter_rows;
|
||||
let $filterRows;
|
||||
|
||||
/**
|
||||
* Filters the block list.
|
||||
@@ -52,24 +52,24 @@
|
||||
|
||||
// Filter if the length of the query is at least 2 characters.
|
||||
if (query.length >= 2) {
|
||||
$filter_rows.each(toggleBlockEntry);
|
||||
$filterRows.each(toggleBlockEntry);
|
||||
Drupal.announce(
|
||||
Drupal.formatPlural(
|
||||
$table.find('tr:visible').length - 1,
|
||||
'1 block is available in the modified list.',
|
||||
'@count blocks are available in the modified list.'
|
||||
)
|
||||
'@count blocks are available in the modified list.',
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
$filter_rows.each(function (index) {
|
||||
$filterRows.each(function (index) {
|
||||
$(this).parent().parent().show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($table.length) {
|
||||
$filter_rows = $table.find('div.block-filter-text-source');
|
||||
$filterRows = $table.find('div.block-filter-text-source');
|
||||
$input.on('keyup', debounce(filterBlockList, 200));
|
||||
}
|
||||
},
|
||||
@@ -91,7 +91,7 @@
|
||||
// Just scrolling the document.body will not work in Firefox. The html
|
||||
// element is needed as well.
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.js-block-placed').offset().top - $container.offset().top + $container.scrollTop(),
|
||||
scrollTop: ($('.js-block-placed').offset().top - $container.offset().top) + $container.scrollTop(),
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
attach: function attach(context, settings) {
|
||||
var $input = $('input.block-filter-text').once('block-filter-text');
|
||||
var $table = $($input.attr('data-element'));
|
||||
var $filter_rows = void 0;
|
||||
var $filterRows = void 0;
|
||||
|
||||
function filterBlockList(e) {
|
||||
var query = $(e.target).val().toLowerCase();
|
||||
@@ -23,17 +23,17 @@
|
||||
}
|
||||
|
||||
if (query.length >= 2) {
|
||||
$filter_rows.each(toggleBlockEntry);
|
||||
$filterRows.each(toggleBlockEntry);
|
||||
Drupal.announce(Drupal.formatPlural($table.find('tr:visible').length - 1, '1 block is available in the modified list.', '@count blocks are available in the modified list.'));
|
||||
} else {
|
||||
$filter_rows.each(function (index) {
|
||||
$filterRows.each(function (index) {
|
||||
$(this).parent().parent().show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($table.length) {
|
||||
$filter_rows = $table.find('div.block-filter-text-source');
|
||||
$filterRows = $table.find('div.block-filter-text-source');
|
||||
$input.on('keyup', debounce(filterBlockList, 200));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,14 +195,14 @@
|
||||
// Find the correct region and insert the row as the last in the
|
||||
// region.
|
||||
tableDrag.rowObject = new tableDrag.row(row[0]);
|
||||
const region_message = table.find(`.region-${select[0].value}-message`);
|
||||
const region_items = region_message.nextUntil('.region-message, .region-title');
|
||||
if (region_items.length) {
|
||||
region_items.last().after(row);
|
||||
const regionMessage = table.find(`.region-${select[0].value}-message`);
|
||||
const regionItems = regionMessage.nextUntil('.region-message, .region-title');
|
||||
if (regionItems.length) {
|
||||
regionItems.last().after(row);
|
||||
}
|
||||
// We found that region_message is the last row.
|
||||
// We found that regionMessage is the last row.
|
||||
else {
|
||||
region_message.after(row);
|
||||
regionMessage.after(row);
|
||||
}
|
||||
updateBlockWeights(table, select[0].value);
|
||||
// Modify empty regions with added or removed fields.
|
||||
|
||||
@@ -119,12 +119,12 @@
|
||||
var select = $(this);
|
||||
|
||||
tableDrag.rowObject = new tableDrag.row(row[0]);
|
||||
var region_message = table.find('.region-' + select[0].value + '-message');
|
||||
var region_items = region_message.nextUntil('.region-message, .region-title');
|
||||
if (region_items.length) {
|
||||
region_items.last().after(row);
|
||||
var regionMessage = table.find('.region-' + select[0].value + '-message');
|
||||
var regionItems = regionMessage.nextUntil('.region-message, .region-title');
|
||||
if (regionItems.length) {
|
||||
regionItems.last().after(row);
|
||||
} else {
|
||||
region_message.after(row);
|
||||
regionMessage.after(row);
|
||||
}
|
||||
updateBlockWeights(table, select[0].value);
|
||||
|
||||
|
||||
+1
@@ -2,6 +2,7 @@ id: d6_block
|
||||
label: Blocks
|
||||
migration_tags:
|
||||
- Drupal 6
|
||||
- Configuration
|
||||
source:
|
||||
plugin: block
|
||||
process:
|
||||
+1
@@ -2,6 +2,7 @@ id: d7_block
|
||||
label: Blocks
|
||||
migration_tags:
|
||||
- Drupal 7
|
||||
- Configuration
|
||||
source:
|
||||
plugin: block
|
||||
process:
|
||||
@@ -19,6 +19,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Provides form for block instance forms.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class BlockForm extends EntityForm {
|
||||
|
||||
|
||||
@@ -105,6 +105,10 @@ class BlockLibraryController extends ControllerBase {
|
||||
$definitions = $this->blockManager->getDefinitionsForContexts($this->contextRepository->getAvailableContexts());
|
||||
// Order by category, and then by admin label.
|
||||
$definitions = $this->blockManager->getSortedDefinitions($definitions);
|
||||
// Filter out definitions that are not intended to be placed by the UI.
|
||||
$definitions = array_filter($definitions, function (array $definition) {
|
||||
return empty($definition['_block_ui_hidden']);
|
||||
});
|
||||
|
||||
$region = $request->query->get('region');
|
||||
$weight = $request->query->get('weight');
|
||||
|
||||
@@ -7,6 +7,8 @@ use Drupal\Core\Url;
|
||||
|
||||
/**
|
||||
* Provides a deletion confirmation form for the block instance deletion form.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class BlockDeleteForm extends EntityDeleteForm {
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ package: Testing
|
||||
dependencies:
|
||||
- block
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457826
|
||||
|
||||
@@ -5,6 +5,11 @@ namespace Drupal\block_test\Form;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Form that performs favorite animal test.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FavoriteAnimalTestForm extends FormBase {
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,11 @@ namespace Drupal\block_test\Form;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Form that performs base block form test.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class TestForm extends FormBase {
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -6,8 +6,8 @@ regions:
|
||||
content: Content
|
||||
help: Help
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457826
|
||||
|
||||
+3
-3
@@ -15,8 +15,8 @@ regions_hidden:
|
||||
- sidebar_first
|
||||
- sidebar_second
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457826
|
||||
|
||||
@@ -8,8 +8,8 @@ dependencies:
|
||||
- block
|
||||
- views
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457826
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Drupal\Tests\block\Unit;
|
||||
|
||||
use Drupal\Core\DependencyInjection\ContainerBuilder;
|
||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||
use Drupal\Tests\Core\Plugin\Fixtures\TestConfigurablePlugin;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
|
||||
@@ -20,11 +21,11 @@ class BlockConfigEntityUnitTest extends UnitTestCase {
|
||||
protected $entityType;
|
||||
|
||||
/**
|
||||
* The entity manager used for testing.
|
||||
* The entity type manager used for testing.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject
|
||||
* @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject
|
||||
*/
|
||||
protected $entityManager;
|
||||
protected $entityTypeManager;
|
||||
|
||||
/**
|
||||
* The ID of the type of the entity under test.
|
||||
@@ -51,8 +52,8 @@ class BlockConfigEntityUnitTest extends UnitTestCase {
|
||||
->method('getProvider')
|
||||
->will($this->returnValue('block'));
|
||||
|
||||
$this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
|
||||
$this->entityManager->expects($this->any())
|
||||
$this->entityTypeManager = $this->getMock(EntityTypeManagerInterface::class);
|
||||
$this->entityTypeManager->expects($this->any())
|
||||
->method('getDefinition')
|
||||
->with($this->entityTypeId)
|
||||
->will($this->returnValue($this->entityType));
|
||||
@@ -60,7 +61,7 @@ class BlockConfigEntityUnitTest extends UnitTestCase {
|
||||
$this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
|
||||
|
||||
$container = new ContainerBuilder();
|
||||
$container->set('entity.manager', $this->entityManager);
|
||||
$container->set('entity_type.manager', $this->entityTypeManager);
|
||||
$container->set('uuid', $this->uuid);
|
||||
\Drupal::setContainer($container);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace Drupal\Tests\block\Unit;
|
||||
|
||||
use Drupal\block\BlockForm;
|
||||
use Drupal\block\Entity\Block;
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Plugin\PluginFormFactoryInterface;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
|
||||
@@ -82,6 +84,32 @@ class BlockFormTest extends UnitTestCase {
|
||||
$this->pluginFormFactory = $this->prophesize(PluginFormFactoryInterface::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mocks a block with a block plugin.
|
||||
*
|
||||
* @param string $machine_name
|
||||
* The machine name of the block plugin.
|
||||
*
|
||||
* @return \Drupal\block\BlockInterface|\PHPUnit_Framework_MockObject_MockObject
|
||||
* The mocked block.
|
||||
*/
|
||||
protected function getBlockMockWithMachineName($machine_name) {
|
||||
$plugin = $this->getMockBuilder(BlockBase::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$plugin->expects($this->any())
|
||||
->method('getMachineNameSuggestion')
|
||||
->will($this->returnValue($machine_name));
|
||||
|
||||
$block = $this->getMockBuilder(Block::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$block->expects($this->any())
|
||||
->method('getPlugin')
|
||||
->will($this->returnValue($plugin));
|
||||
return $block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the unique machine name generator.
|
||||
*
|
||||
|
||||
@@ -49,6 +49,7 @@ class BlockPageVariantTest extends UnitTestCase {
|
||||
$container = new Container();
|
||||
$cache_context_manager = $this->getMockBuilder('Drupal\Core\Cache\CacheContextsManager')
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['assertValidTokens'])
|
||||
->getMock();
|
||||
$container->set('cache_contexts_manager', $cache_context_manager);
|
||||
$cache_context_manager->expects($this->any())
|
||||
@@ -209,9 +210,6 @@ class BlockPageVariantTest extends UnitTestCase {
|
||||
$title_block_plugin = $this->getMock('Drupal\Core\Block\TitleBlockPluginInterface');
|
||||
foreach ($blocks_config as $block_id => $block_config) {
|
||||
$block = $this->getMock('Drupal\block\BlockInterface');
|
||||
$block->expects($this->any())
|
||||
->method('getContexts')
|
||||
->willReturn([]);
|
||||
$block->expects($this->atLeastOnce())
|
||||
->method('getPlugin')
|
||||
->willReturn($block_config[1] ? $main_content_block_plugin : ($block_config[2] ? $messages_block_plugin : ($block_config[3] ? $title_block_plugin : $block_plugin)));
|
||||
|
||||
Reference in New Issue
Block a user