This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
langcode: en | |
status: true | |
dependencies: { } | |
id: upgrade | |
label: 'Import from Database' | |
description: 'Migrations originally generated from drush migrate-upgrade --configure-only' | |
source_type: 'Drupal 7' | |
module: null | |
shared_configuration: | |
source: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
Foo``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function testFieldProviderCore() { | |
/** @var \Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface $plugin_manager */ | |
$plugin_manager = $this->container->get('plugin.manager.migrate.field'); | |
$this->setExpectedException(InvalidPluginDefinitionException::class, 'The missing_core plugin should define the core property.'); | |
$this->setExpectedException(InvalidPluginDefinitionException::class, 'The missing_source plugin should define the source_module property.'); | |
$this->setExpectedException(InvalidPluginDefinitionException::class, 'The missing_destination plugin should define the destination_module property.'); | |
$plugin_manager->getDefinition('missing_core'); | |
$plugin_manager->getDefinition('missing_source'); | |
$plugin_manager->getDefinition('missing_destination'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CartOnlySingleItem implements EventSubscriberInterface { | |
use StringTranslationTrait; | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function getSubscribedEvents() { | |
return [ | |
CartEvents::CART_ENTITY_ADD => ['limitNumberEntriesAdd'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require-dev": { | |
"drupal/coder": "^8.2", | |
"jakub-onderka/php-parallel-lint": "^0.9.2", | |
"phpmd/phpmd": "^2.6", | |
"phpro/grumphp": "^0.11.6", | |
"phpunit/phpunit": "^5", | |
"sebastian/phpcpd": "^3.0", | |
"sensiolabs/security-checker": "^4.1" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For anonymous users, we need to start session before storing in private | |
// temp store, otherwise a new session_id will be created each page view | |
// and the preious private store values will be inaccessible. | |
if ($this->currentUser->isAnonymous() && !$this->request->getSession()->get('session_started')) { | |
$this->request->getSession()->set('session_started', TRUE); | |
$this->sessionManager->start(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\custom_module\EventSubscriber; | |
use Drupal\commerce_order\Entity\OrderInterface; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Session\AccountProxyInterface; | |
use Drupal\Core\StringTranslation\StringTranslationTrait; | |
use Drupal\rng\RegistrantFactoryInterface; | |
use Drupal\state_machine\Event\WorkflowTransitionEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritdoc} | |
*/ | |
public function processDefinition(&$definition, $plugin_id) { | |
parent::processDefinition($definition, $plugin_id); | |
// Loop over each of the definitions and categorize it as config or content. | |
if (!empty($definition['class'])) { | |
$configuration_classes = [ | |
EntityConfigBase::class, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* The key of the array might to be changed. In this case, the new id property needs to be the key. | |
* It'd be possible to just add key: "@id" to the iterator process but that | |
* would require special casing the key property and somehow escape it when | |
* there is actually a destination called key. Instead, it is moved out of the | |
* process and key is in the configuration of iterator itself: | |
* @code | |
* process: | |
* filters: | |
* plugin: iterator | |
* source: filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT field_data_field_referring_domain0.entity_type AS entity_type, field_data_field_referring_domain0.entity_id AS entity_id, field_data_field_referring_domain0.revision_id AS revision_id, field_data_field_referring_domain0.bundle AS bundle | |
FROM | |
{field_data_field_referring_domain} field_data_field_referring_domain0 | |
INNER JOIN {field_data_field_referring_domain} field_data_field_referring_domain1 ON field_data_field_referring_domain1.entity_type = field_data_field_referring_domain0.entity_type AND field_data_field_referring_domain1.entity_id = field_data_field_referring_domain0.entity_id | |
INNER JOIN {field_data_field_referring_domain} field_data_field_referring_domain2 ON field_data_field_referring_domain2.entity_type = field_data_field_referring_domain0.entity_type AND field_data_field_referring_domain2.entity_id = field_data_field_referring_domain0.entity_id | |
INNER JOIN {field_data_field_referring_domain} field_data_field_referring_domain3 ON field_data_field_referring_domain3.entity_type = field_ |