This file contains hidden or 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
default: | |
formatters: | |
defaultFormat: | |
name: 'progress' |
This file contains hidden or 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
$results = db_select('flood')->fields(NULL, array('expiration'))->execute()->fetchAll(); | |
$count = count($results); | |
dpm($count); | |
db_delete('flood') | |
->execute(); | |
$results = db_select('flood')->fields(NULL, array('expiration'))->execute()->fetchAll(); | |
$count = count($results); | |
dpm($count); |
This file contains hidden or 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
/** | |
* @Then /^I fill in wysiwyg field "([^"]*)" with "([^"]*)"$/ | |
*/ | |
public function iFillInWysiwygOnFieldWith($locator, $value) { | |
$el = $this->getSession()->getPage()->findField($locator); | |
$fieldId = $el->getAttribute('id'); | |
if (empty($fieldId)) { | |
throw new Exception('Could not find an id for field with locator: ' . $locator); | |
} |
This file contains hidden or 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
$config_installer = \Drupal::service('config.installer'); | |
$config_installer->installDefaultConfig('module', 'mymodule_name'); |
This file contains hidden or 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
composer config repositories.drupal composer https://packages.drupal.org/8 |
This file contains hidden or 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
$migration_id = 'ncsbn_migrate_import_menu_items'; | |
$migration = \Drupal::service('plugin.manager.migration')->createInstance($migration_id); | |
$executable = new \Drupal\migrate\MigrateExecutable($migration, new \Drupal\migrate\MigrateMessage()); | |
$executable->import(); |
This file contains hidden or 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
$uuid_service = \Drupal::service('uuid'); | |
$uuid = $uuid_service->generate(); |
This file contains hidden or 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
composer create-project drupal-composer/drupal-project:8.x-dev projectname --stability dev --no-interaction |
This file contains hidden or 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
use Drupal\field\Entity\FieldStorageConfig; | |
use Drupal\field\Entity\FieldConfig; | |
$entity_type = 'node'; | |
$bundles = entity_get_bundles('node'); | |
$fields = ['field_phone', 'field_fax']; | |
foreach ($bundles as $bundle) { | |
foreach ($fields as $field_name) { | |
$field = FieldConfig::loadByName($entity_type, $bundle, $field_name); |