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
diff --git a/core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php b/core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php | |
index ff41106..6c4caa2 100644 | |
--- a/core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php | |
+++ b/core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php | |
@@ -37,6 +37,8 @@ trait EntityChangesDetectionTrait { | |
} | |
} | |
+ \Drupal::moduleHandler()->alter('fields_to_skip_from_translation_changes', $fields, $entity); | |
+ |
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
use Drupal\field\Entity\FieldStorageConfig; | |
/** | |
* Resize field. | |
*/ | |
function demo_field_resize_update_8001() { | |
$field_name = 'field_to_resize'; | |
$entity_type = 'node'; | |
$database = \Drupal::database(); | |
$database->query("ALTER TABLE node__" . $field_name . " MODIFY " . $field_name . "_value VARCHAR(200)"); |
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
#!/bin/bash | |
SITE=$1 | |
USER=${2-demo} | |
BASE_PASSWORD=${3-secretsecret} | |
ALL_ENVS="$(terminus env:list $SITE --field=id | grep -v live)" | |
for ENV in $ALL_ENVS ; do | |
is_locked="$(terminus lock:info "$SITE.$ENV" --field=locked)" |
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
docker-compose up -d --no-deps --build <service> |
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
protected function viewValue(FieldItemInterface $item) { | |
// The text value has no text format assigned to it, so the user input | |
// should equal the output, including newlines. | |
$url = Url::fromUri('mailto:' . $item->value); | |
return Link::fromTextAndUrl(t('Send Email'), $url)->toString(); | |
} |
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
composer require --dev drupal/console:~1.0 --prefer-dist --optimize-autoloader |
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
location / { | |
# try_files $uri @rewrite; # For Drupal <= 6 | |
try_files $uri /index.php?$query_string; # For Drupal >= 7 | |
} |
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
// En Settings.php | |
$local_settings = __DIR__ . "/settings.local.php"; | |
if (file_exists($local_settings)) { | |
include $local_settings; | |
} | |
if (empty($settings['hash_salt'])) { | |
$settings['hash_salt'] = hash('sha256', serialize($databases)); | |
} |
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 | |
/** | |
* This works for Selenium and other real browsers that support screenshots. | |
* | |
* @Then /^show me an screenshot$/ | |
*/ | |
public function showMeAnScreenshot() { | |
$image_data = $this->getSession()->getDriver()->getScreenshot(); |
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
$vocabulary = taxonomy_vocabulary_machine_name_load($name); | |
$vid = $vocabulary->vid; | |
$term = new stdClass(); | |
$term->vid = $vid; | |
$term->name = 'foo'; | |
$term->description = 'bar'; | |
taxonomy_term_save($term); |
NewerOlder